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

how do i make clicking a gui toggle a script?

i how i change if a script is active (localy) by clicking a gui? i wanna use this for the game im working on but allas, i dont know how. :(

3 comments

0

if you need more info ask and ill respond as soon as i can

0

Can you explain more, I don't understand

0

so basicly, i want clicking a text button to change the disabled value on a script, but not for everyone if that makes sence.

1 answer

✓ Accepted answer

Detect if the gui is pressed, then simply make the value of script.Disabled the opposite of what it is. Something like

ScriptToChange = [wherever it is]

Script.parent.MouseButton1Down:connect(function()

     ScriptToChange.Disabled = not ScriptToChange.Disabled

end)

Simple when the gui is clicked, the disabled value of the script to change goes to the opposite of what it is, so it turns into what it was not.

Also I don't know if you just wrote your thing weird or if you don't understand localscripts because it won't "change for everyone", it's local. If you dont understand then please read about it

I hope this helps :3

1 comment

0

thanks, this is really close to what i was looking for, so i can just edit it a bit. thanks!

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