#How to reference leaderstats in another script?
38 messages · Page 1 of 1 (latest)
no it’s inside of a click detector, which is inside a part that was spawned in using :clone, i’ll send a pic one sec
regular script
Ok
game.Players.LocalPlayer:WaitForChild("leader")
It’s not a local script
Show me the script for click detector
click detector has as player parameter
That would only affect one player and the leaderstats would not save
Or change on the server
all i have, i’ve tried using :waitforchild(“leaderstats”):waitforchild(“points”).Value
but it did not work, same error
alright
Now just try print(player.Name) inside function
it printed my name correctly
Ok
Now
Just local leaderstats = player:WaitForChild(“leaderstats”)
local Points = leaderstats:WaitForChild(“Points”)
print(Points.Value)
Should work
👍
leaderstats updated correctly
If u got more question u can dm me
sounds good 👍