PLR = game.Players:GetChildren(game.Workspace.GREEN.PLRNAME.Value)
> function onClicked()
> if PLR.leaderstats.Money.Value >49 then
game.Lighting.oldmachinegreensmall.Parent = game.Workspace
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
then it gives an error:
Workspace.Sign.Text.Script:10: attempt to index field 'leaderstats' (a nil value)

11 comments
i also have an leaderboard.
Change "GetChildren" to "findFirstChild" in the first line
ok ill try
No. Just learn Lua tbh.
Workspace.Sign.Text.Script:10: attempt to index global 'PLR' (a nil value) 21:55:35.167 - Stack Begin
OOOFFFF
You can't access Players through a ServerScript, try using a for i,v loop to gatheall the players into a table using the table value inside the parentheses of pairs game.Players:GetPlayers()
That is if it's a ServerScript, also instead of using a StringValue from workspace, just call it through ""
ill have to explain everything to fix this problem.
Just learning Lua is exactly what he's doing. Why not try to help the kid? Anyways, the problem is basically saying that the script couldn't find a player whose name was the same as game.Workspace.GREEN.PLRNAME.Value so what you need to do is make sure that that value contains a valid player name at the time that the variable PLR is defined
kid? I am an angry teenager