|
| 03 Jan 2016 06:35 AM |
game.Players.PlayerAdded:connect(function(plr) local stats = Instance.new('IntValue', plr) stats.Name = 'leaderstats' local experience = Instance.new('IntValue', stats) experience.Name = 'EXP' experience.Value = 0 local level = Instance.new('StringValue', stats) level.Name = 'Repuation' level.Value = ("Rookie 1") experience.Changed:connect(function() end) I am bit new to scripting so under [ experience.Changed:connect(function() ] what should I put if every 1000 xp player ranks up to Rookie 1, 2, 3. Tried
if experience.Value = 1000 then level.Value = ("Rookie 2") end
But it would only allow me to do that twice |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 06:45 AM |
| Found problemo is good now |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 06:46 AM |
You need to process each time the experience get's amended to.
Since you are using a static number, you can just divide it.
experience.Changed:connect(function() local number = experience.Value / 1000 repeat if(number >= 1)then level.Value = level.Value + 1 experience.Value = experience.Value - 1 end number = experience.Value / 1000 until number < 1 end) |
|
|
| Report Abuse |
|
|
| |
|