Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why i cant change the Rank on the leaderboard when i get 10 Points?

i want to change the rank to beginner when a player get 10 points but the ranking does not change any help?

local player = game.Players.LocalPlayer

if player.leaderstats.Points.Value == 10 then
	player.leaderstats.Rank.Value = "Beginner"
			
end

and this is my leaderboard script


game.Players.PlayerAdded:Connect(function(player)

	local stats = Instance.new("Folder", player)
	stats.Name = "leaderstats"
	
	local Points = Instance.new("IntValue", stats)
	Points.Name = "Points"
	Points.Value = 0
	
	local Rank = Instance.new("StringValue", stats)
	Rank.Name = "Rank"
	Rank.Value = "Noob"
	
 end)

2 comments

0

Are you sure you have exactly 10? If you more than change line 3 to: if player.leaderstats.Points.Value >= 10 then

0

is that the enitire leaderboard script? b/c if so, no doubt any changes will get saved

1 answer

  1. Consider that the localscript will check the if statement once and never come back. Try using an event.
  2. Given that operator == checks if two values are the same, then it wouldn't change your rank if the amount of points never hit 10. Ie, start at 3 and increment by two. Consider using operators >=, <=, >, or <.

2 comments

0

what event shuold i use

0

Varies maybe .Changed

This discussion is preserved as it was. New answers, comments, and votes are closed.