PlayerAdded
doesn't work in a localscript, but I need a localscript in order to make my game work.
Can someone help me? This is what I have:
--Location: game.Workspace --This is a localscript function plradded(plr) local gui=Lighting.Gui:Clone() gui.Parent=plr.PlayerGui wait(3) gui=nil end game.Players.PlayerAdded:connect(plradded)
The other way works, But easiest fix is changing PlayerAdded to ChildAdded. This should work in LS, and look like this...
--Location: game.Workspace --This is a localscript function plradded(plr) local gui=Lighting.Gui:Clone() gui.Parent=plr.PlayerGui wait(3) gui=nil end game.Players.ChildAdded:connect(plradded)
Use two different scripts and then use RemoteObjects (RemoteEvent/RemoteFunction) if you need them to work together