Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there a way to execute LocalScripts with custom execute GUI?

I am working on an execute GUI and I was wondering if there is a way to execute LocalScripts from it? I don't even know if you can execute LocalScripts from an executer, but I have seen it before. I have no idea how to do it.

You can't set the Source of it, and I don't know why.

I don't have any script to post, well, because I do not know how.

3 comments

0

The question doesn't make any sense. LocalScripts run in GUIs... What are you asking?

0

Whenever you post a question, you need to give a detailed and understandable explanation of what you're wanting help with, so that the helpers can better help you.

0

Set a source of a localscript to what the textbox sasys

1 answer

Every type of script has a Disabled property. In your script, you can make it so when the Execute button is clicked, the Disabled property is off, so it enables the script to run. You can also make a Stop button that stops the script from running, just make it so that it changes the script's Disabled property to true.

NOTE: Make sure before you save your game, the script's Disabled is true so it doesnt run until you click execute.

EXAMPLE:

local myScript = workspace.Script
local executeButton = script.Parent
local disableButton = script.Parent.Parent.Disable
executeButton.MouseButton1Down:connect(function()
	myScript.Disabled = false --Makes the script run
end)

disableButton.MouseButton1Down:connect(function()
	myScript.Disabled = true --Makes the script stop running
end)

Hope this helped :)

This discussion is preserved as it was. New answers, comments, and votes are closed.