XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:37 PM |
So it works fine but once the player dies it breaks, please fix this It is a LocalScript in StarterGui
Thanks!
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 |
|
|
2unknown2
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 9351 |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:41 PM |
So that should work? Thanks going to try it |
|
|
| Report Abuse |
|
|
2unknown2
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 9351 |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:42 PM |
Testing now btw it works fine but just for first time, once you die it breaks |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2013 08:44 PM |
local Name = "Hunger" local Time = 5 local Player = Game.Players.LocalPlayer local Person = Player.Character local Stat = Player.leaderstats[Name] local sure = true
Stat.Value = 10
while sure do wait(Time) Stat.Value = Stat.Value - 1 if Stat.Value == 0 then Person:BreakJoints() sure = false end end Person:BreakJoints() |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:45 PM |
@2 Didn;t work
@screw trying now thanks |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:52 PM |
is it possible to make it so when they die the script clone() then deletes old script? |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:53 PM |
Output? Sorry I am new to scripting |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:54 PM |
Wait I think i found the problem LOL
wait(Time)
DIDN'T FILL IN |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2013 08:55 PM |
Why would you do that o-o.....
You're saying it's in startergui, so it should just already be copied into the player's playergui whenever the character's spawned o-o |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:56 PM |
Still doesn't kill them Maybe if I try removing head rather than breakjoints |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 08:57 PM |
| The script doesn't seem to repeat itself after it is used once |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2013 09:00 PM |
What happens to the hunger stat after the player dies? Does it stay 0? |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 09:02 PM |
It stays 0 but once they respawn it is 10 again Now they don't die at ALL and I had to reset upon entry to get the script running but that isn't a big deal, it's the not dying at all and the Hunger staying at 0 until they reset |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
|
| 17 Apr 2013 09:14 PM |
| So after they die, the value goes back to 10 and still goes down? like 9,8,7,6... |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 09:19 PM |
| Still goes down but they don't die ever |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
|
| 17 Apr 2013 10:59 PM |
Go up to..
View > Output
Run script.
Post Output here so we can figure out your problem. |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 17 Apr 2013 11:03 PM |
| leaderstats is not a valid member of Player |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2013 11:05 PM |
This line is messed up
--local Stat = Player.leaderstats[Name]--
Look inside your Player. The script can't find it. |
|
|
| Report Abuse |
|
|