Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Brick that awards points help?

Asked by 10 years ago

Hey there, space here I have been trying the same script over 20 times and doesn´t work please help me fix it heres the script for the brick

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)

Heres the leaderbord in case the error is in it

game.Players.PlayerAdded:connect(function(player) local leader = Instance.new('IntValue', player) local score = Instance.new('IntValue', leader) leader.Name = 'leaderstats' score.Name = 'Score' end)

Answer this question