I've asked this before, and got a good answer, but after awhile, when I clicked the part the Gui didn't go in the PlayerGui and the player couldn't see the Gui.
local gui = script.Parent.Parent.Parent.night_GUI:Clone() function Equip() gui.Parent = game.Players.LocalPlayer.PlayerGui wait(1) script.Disabled = true wait(60) script.Disabled = false end script.Parent.MouseClick:connect(Equip)
Any help please? THIS IS NOT A LOCALSCRIPT!
Don't use Disabled
to control your scripts.
For one thing, if the script is disabled it won't be able to undisable itself.
I'm not sure why you are disabling it.
A LocalScript probably won't run in a random brick in the workspace; regardless of where it is, I don't believe it can use a ClickDetector.
I'd recommend using debounce instead of "disabled." Debounce makes a script inactive for a period of time, but it doesn't completely stop it. Here is your code I rewrote for you, using debounce:
local gui = script.Parent.Parent.Parent.night_GUI:Clone() function Equip() gui.Parent = game.Players.LocalPlayer.PlayerGui wait(1) debounce = true wait(60) debounce = false end script.Parent.MouseClick:connect(Equip)
Think of debounce, like a timer. The timer has to get to zero before it can be set again. Same applies in scripts. Debounce is like that timer. It prevents the script from reactivating for a period of time.
Only thing I see wrong is you need a wait(.5) at the top of the script cause local scripts load faster than roblox's respawning system.