I have this script
game:GetService('Players').PlayerAdded:connect(function(player) if player:FindFirstChild("Points") ~= nil then if player.Points.Value > 0 and player.Points.Value <= 40 then player.leaderstats.Rank.Value = "Private" elseif player.Points.Value > 40 and player.Points.Value <= 100 then player.leaderstats.Rank.Value = "General" end end end)
but it only works when the player enters the game for the first time, so how would I make it work everytime the player respawns?
You would need to use the function built into the player, .CharacterAdded, here is an example:
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function()--Added function if player:FindFirstChild("Points") ~= nil then if player.Points.Value > 0 and player.Points.Value <= 40 then player.leaderstats.Rank.Value = "Private" elseif player.Points.Value > 40 and player.Points.Value <= 100 then player.leaderstats.Rank.Value = "General" end)--Added end end end end)
This should work, if it does, or helps you, could you accept the answer? It gives us both rep!