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 |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
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 |
|
|
|
| 15 Apr 2013 07:13 PM |
| It Must be a local script or will error if playing on a server. |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
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 |
|
|
|
| 15 Apr 2013 07:23 PM |
| That should not matter...Are you sure your waiting 5 secs for it to change... |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 15 Apr 2013 07:28 PM |
| Hmm it is working now, thanks! |
|
|
| Report Abuse |
|
|