I have this script, and the line it breaks on is "player.leaderstats.points.Name = player.leaderstats.Credits + 200" The reason is the stats on the leader are points but are named under Credits.
This is the script:
game.Workspace.ChildAdded:connect(function(child)
if child.Name == "HostageFree" then
script.Sound:Play()--Don't worry about here and above
for _,player in pairs(game.Players:GetPlayers()) do
if player.TeamColor == BrickColor.Red() then
player.leaderstats.points.Name = player.leaderstats.Credits + 200 --Broken line
wait(7) --Don't worry about here and below
local pl = game.Players:GetChildren()
for i=1,#pl do
pl[i].Character.Humanoid.Health = 0
game.Workspace.HostageFree:Remove()
end
end
end
end
end)
NOTICE: the leaderboard stat is points but I named them Credits so when it appears on players leaderboard ingame it appears as Credits but still is referred to as points in script. But you have to add +200 to Credits

7 comments
I use the kill function to change player team colors and to remove their weapons
Okay, well you can replace it if you want..
No its fine, but the script part where giving the players the points didnt work
Changed it.
I tried that too ealier myself, didnt work, read my updated notice
Now try.
i fixed it myself take a look below.