Hello, I am getting these random errors (The one in the title.), I have dug through it and tried to figure out my issue, but I just cant fix it, anyways here is the code, thanks!
-SupremeStarfish local plr = game.Players.LocalPlayer local reward = 25 local winreward = 1 local DisplayStatus = game.ReplicatedStorage:WaitForChild("Status") local leaderstats = plr.leaderstats << This is where the nil happened I already made a leaderstats inside the player in a different script.
script.Parent.Touched:Connect(function() DisplayStatus.Value = plr.Name.." has won!" leaderstats.Points.Value = leaderstats.Points.Value + reward leaderstats.Wins.Value = leaderstats.Wins.Value + winreward end)
I wonder.. What type of script did you enter:
local plr = game.Players.LocalPlayer
?
If this is a localscript then, alright, but if it is a server-sided script, then this won't work. ^^
The error is telling us that the variable "plr" is nil, or in other words: does not exist.
Good luck with the further development!