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: Please fix this script

Previous Thread :: Next Thread 
XoDust is not online. 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 is not online. 2unknown2
Joined: 30 Oct 2011
Total Posts: 9351
17 Apr 2013 08:40 PM
its

Person:breakJoints()
Report Abuse
XoDust is not online. 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 is not online. 2unknown2
Joined: 30 Oct 2011
Total Posts: 9351
17 Apr 2013 08:42 PM
Yes it should.
Report Abuse
XoDust is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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 is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 08:47 PM
Didn't work either...
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
17 Apr 2013 08:52 PM
Output?
Report Abuse
XoDust is not online. 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 is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 08:53 PM
Output?
Sorry I am new to scripting
Report Abuse
XoDust is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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 is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
17 Apr 2013 09:00 PM
What happens to the hunger stat after the player dies?
Does it stay 0?
Report Abuse
XoDust is not online. 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 is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 09:11 PM
Bump
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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 is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 09:43 PM
bump
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 10:48 PM
bump
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
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 is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:03 PM
leaderstats is not a valid member of Player
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
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
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