How to disable and enable back a script?
Asked by
2 years ago Edited 2 years ago
Hi i created a part that when u click it disable a script that contains the ”MainScript”,
and it works, but.. it just that when i enable the script, the script woldnt work, do u guys know why? :D i use this script to”close it”:
1 | MainGame = game.ServerScriptService.MainGame |
4 | MainGame.Disabled = true |
8 | script.Parent.ClickDetector.MouseClick:connect(onClick) |
and to ”open it” :
1 | MainGame = game.ServerScriptService.MainGame |
4 | MainGame.Disabled = false |
8 | script.Parent.Touched:connect(onTouch) |
but,as i sayd, when you ”open it” it woldnt work...