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

Why won't this script work?

I've asked this before, got one answer, tried it and it worked in STUDIO mode. Not in PLAY mode on the website. I looked through it millions of times and its all correct. What is going on? This is not a local script.

wait(.5)
local gui =  script.Parent.Parent.Parent.night_GUI:Clone()

function Equip()
	gui.Parent = game.Players.LocalPlayer.PlayerGui
end
script.Parent.MouseClick:connect(Equip)

2 comments

0

Is it a tool?

0

No

1 answer

✓ Accepted answer

Only LocalScripts can use LocalPlayer. Rework your script to get the Player a different way, e.g.

player = script.Parent.Parent.Parent
wait(.5)
local gui = ......

1 comment

0

Ok this makes sense. Thank you very much!

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