So I am making a D-Day game based off of Call of Duty: WW2. Every time a player gets a certain amount of points they get a new rank, and they're character loads back up. Why does this not work? Can you fix my script?
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.Character
local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = plr
local rank = Instance.new('StringValue')
rank.Name = 'Rank'
rank.Value = 'Private'
rank.Parent = leaderstats
local points = Instance.new('IntValue')
points.Name = 'XP'
points.Value = 0
points.Parent = leaderstats
while true do
wait(1)
points.Value = points.Value + 10
end
if (points.Value >= 50) then
rank.Value = 'Private First Class'
char:LoadCharacter()
end
if (points.Value >= 100) then
rank.Value = 'Private Second Class'
char:LoadCharacter()
end
end)

2 comments
That didn't work.
Give more detail other than "That didn't work." What is not working