Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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

1local player = game.Players.LocalPlayer
2 
3if player.leaderstats.Points.Value == 10 then
4    player.leaderstats.Rank.Value = "Beginner"
5 
6end

and this is my leaderboard script

01game.Players.PlayerAdded:Connect(function(player)
02 
03    local stats = Instance.new("Folder", player)
04    stats.Name = "leaderstats"
05 
06    local Points = Instance.new("IntValue", stats)
07    Points.Name = "Points"
08    Points.Value = 0
09 
10    local Rank = Instance.new("StringValue", stats)
11    Rank.Name = "Rank"
12    Rank.Value = "Noob"
13 
14 end)
0
Are you sure you have exactly 10? If you more than change line 3 to: if player.leaderstats.Points.Value >= 10 then raid6n 2196 — 5y
0
is that the enitire leaderboard script? b/c if so, no doubt any changes will get saved aprilsfooled 29 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
  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 <.
0
what event shuold i use Ebrahim964 2 — 5y
0
Varies maybe .Changed SoftlockedUnderZero 668 — 5y
Ad

Answer this question