0% found this document useful (0 votes)
170 views1 page

LocalScript for Running Scripts in Roblox

This document provides a Lua script for Roblox that creates a user interface with a text box and a button. Users can type scripts into the text box and run them by clicking the 'Run Script' button. If there is an error in the script, a warning will be displayed in the output console.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views1 page

LocalScript for Running Scripts in Roblox

This document provides a Lua script for Roblox that creates a user interface with a text box and a button. Users can type scripts into the text box and run them by clicking the 'Run Script' button. If there is an error in the script, a warning will be displayed in the output console.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- Place this in a LocalScript inside StarterPlayerScripts

local ScreenGui = [Link]("ScreenGui",


[Link]:WaitForChild("PlayerGui"))
local TextBox = [Link]("TextBox", ScreenGui)
[Link] = [Link](0.5, 0, 0.3, 0)
[Link] = [Link](0.25, 0, 0.1, 0)
[Link] = "-- Type your script here"
[Link] = true
[Link] = false

local RunButton = [Link]("TextButton", ScreenGui)


[Link] = "Run Script"
[Link] = [Link](0.2, 0, 0.05, 0)
[Link] = [Link](0.4, 0, 0.45, 0)

RunButton.MouseButton1Click:Connect(function()
local code = [Link]
local success, err = pcall(function()
local func = loadstring(code)
if func then
func()
end
end)
if not success then
warn("Script Error:", err)
end
end)

You might also like