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

Why won't this script work?

Asked by 10 years ago

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)

0
Is it a tool? EzraNehemiah_TF2 3552 — 10y
0
No PyccknnXakep 1225 — 10y

1 answer

Log in to vote
5
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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 = ......
0
Ok this makes sense. Thank you very much! PyccknnXakep 1225 — 10y
Ad

Answer this question