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 » Scripting Helpers
Home Search
 

Re: Script that makes a certain leaderboard stat decrease

Previous Thread :: Next Thread 
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 06:42 PM
can someone make me a script that makes a leaderboard stat decrease over time, say 5 seconds each and when it hits 0 you die?
Report Abuse
Disclaimed is not online. Disclaimed
Joined: 22 Feb 2013
Total Posts: 70
15 Apr 2013 06:44 PM
What stat is it called?
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 06:52 PM
Hunger but you can make it anything ik how to edit variables
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
15 Apr 2013 06:55 PM
Localscript in startergui.

local Name = "Hunger"
local Time = 5

local Player = Game.Players.LocalPlayer
local Person = Player.Character
local Stat = Player.leaderstats[Name]
while wait(Time) do
Stat.Value = Stat.Value - 1
if Stat.Value == 0 then
break
end
end
Person:BreakJoints()
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 06:55 PM
Ty!
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:09 PM
hmm it isn't working...
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:12 PM
Ah it's working now, it wasn't a localscript, lol

also how do I make it so everytime they respawn they get 10 hunger?
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
15 Apr 2013 07:13 PM
It Must be a local script or will error if playing on a server.
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:14 PM
Wait it's not working lol
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:14 PM
Nothing happens, I added a leaderboard stat called Hunger too
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:16 PM
It works fixed it, thanks!
Can anyone make it so whenever you respawn you start with 10 hunger? I only have it so when you enter game it is 10
Report Abuse
Swordphin123 is not online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
15 Apr 2013 07:17 PM
Editted his script to also have the 10 Hunger respawn thing too.

~~~~

local Name = "Hunger"
local Time = 5
local Player = Game.Players.LocalPlayer
local Person = Player.Character
local Stat = Player.leaderstats[Name]

Stat.Value = 10

while wait(Time) do
Stat.Value = Stat.Value - 1
if Stat.Value == 0 then
break
end
end
Person:BreakJoints()
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:17 PM
ty
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:19 PM
it isn't working, its only working if i make it decrease every second
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
15 Apr 2013 07:23 PM
That should not matter...Are you sure your waiting 5 secs for it to change...
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:23 PM
I waited over 20 and it did nothing
I am going to try making it decrease by 1 but you start with 50
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:25 PM
@sword

can you make it so it spawns you with 100 and decreases once per second?

Thanks
Report Abuse
Swordphin123 is not online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
15 Apr 2013 07:28 PM
Can you read the script and stop asking us to create it? It should be pretty straight forward.
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
15 Apr 2013 07:28 PM
Hmm it is working now, thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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