Script is not increasing a value and doing as it should, with no errors?
I tried making a ranking system, and the script is supposed to increase a value in the player called "xp"
These are the ranks (they might have to do with the error):
And this is the rank function (in module script):
01 | function module.giveXPOrRankPlayer(plr,amount) |
03 | local gui = game.ReplicatedStorage.UI.GainNotif:Clone() |
04 | gui.Parent = plr.PlayerGui |
05 | gui.TextLabel.Text = "+" ..amount.. " XP" |
06 | gui.FireTweenAndTrans:FireClient(plr) |
08 | plr.Value = plr.Value + amount |
09 | print (plr.Name.. " has been given " ..amount.. " XP" ) |
10 | for i, rank in pairs (ranks) do |
11 | if plr.XP.Value > = rank.XPneeded then |
12 | if ranks [ i ] = = plr.Rank.Value then |
14 | plr.Rank = ranks [ nextRank ] |
16 | local converted = tostring (rank) |
17 | print (plr.Name.. " has ranked up to " ..converted.. ", " ..plr.XP.Value.. " XP" ) |
Why doesn't the script increase the value/xp?