generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help with this rank up script!

Previous Thread :: Next Thread 
MarcusDomitiusScipio is not online. MarcusDomitiusScipio
Joined: 11 Aug 2009
Total Posts: 331
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
MarcusDomitiusScipio is not online. MarcusDomitiusScipio
Joined: 11 Aug 2009
Total Posts: 331
03 Jan 2016 06:45 AM
Found problemo is good now
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
MarcusDomitiusScipio is not online. MarcusDomitiusScipio
Joined: 11 Aug 2009
Total Posts: 331
03 Jan 2016 07:09 AM
thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image