Hey there biocommand here, I am working in some games and have the same problem with this, what I am trying to do is a brick that awards points when the player steps on it (Not player points) and it´s not working I used the one from roblox wiki and it might be outdated, heres the script:
local enabled = true
game.Players.PlayerAdded:connect(function(player)
local leader, score = Instance.new('IntValue', player), Instance.new('IntValue')
leader.Name = 'leaderstats'
score.Name = 'Score'
score.Parent = leader
end)
Workspace.Button.Touched:connect(function(hit)
local p = game.Players:FindFirstChild(hit.Parent.Name)
if pl and enabled == true then
enabled = false
p.leaderstats.Score.Value = p.leaderstats.Score.Value + 5
wait(20)
enabled = true
end
end)
here´s the leaderboard if the problem is with that
game.Players.PlayerAdded:connect(function(player)
local leader, score = Instance.new('IntValue', player), Instance.new('IntValue')
leader.Name = 'leaderstats'
score.Name = 'Score'
score.Parent = leader
end)
Also I put both with scripts, not local scripts.

4 comments
Thanks I already corrected the pl, but what do I do in the first error? I mean how do I correct that? I am new to scripting
Whoops, nevermind. You should be fine as long as you've fixed that error. I just saw that you were using FindFirstChild. Is the script working? Are there any errors in output? I'd be glad to help
its working fine :D thank you very much :D
Mhm - no problem!