Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make clicking a gui toggle a script?

Asked by 3 years ago
Edited 3 years ago

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. :(

0
if you need more info ask and ill respond as soon as i can steel_apples 58 — 3y
0
Can you explain more, I don't understand MarkedTomato 810 — 3y
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. steel_apples 58 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

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

0
thanks, this is really close to what i was looking for, so i can just edit it a bit. thanks! steel_apples 58 — 3y
Ad

Answer this question