Hi. I have made a rank system but I can't find a proper way to make it award a rank with XP. (Yes, experience is NOT located in leaderstats since it's meant to be hidden.) Here is my code, please help!
for i, v in pairs(game.Players:GetPlayers()) do if v.experience.Value == 50 then v.leaderstats.Rank.Value = 'Private' end end
Use :GetPropertyChangedSignal("Value", instance) on the XP value.
In the future, please provide more code. I.E your full leaderstats script or XP system. If this helped, mark it as a solution!
Next time please provide more code.
game.Players.PlayerAdded:Connect(function(player)--Fired when the player is added into the game local Experience = player:WaitForChild("experience")--The Experience variable local Rank = player:WaitForChild("leaderstats"):WaitForChild("Rank")--The Rank variable Experience.Changed:Connect(function()--Fired when the value is changed if Experience.Value == 50 then--Checks if the Experience is equal to 50 Rank.Value = "Private"--Rank is now set to Private end end) end)