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 4 years ago
Edited 4 years ago

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)
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 — 4y
0
is that the enitire leaderboard script? b/c if so, no doubt any changes will get saved aprilsfooled 29 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 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 — 4y
0
Varies maybe .Changed SoftlockedUnderZero 668 — 4y
Ad

Answer this question