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: Kill a player if value is equal to one

Previous Thread :: Next Thread 
y1p is not online. y1p
Joined: 05 May 2013
Total Posts: 350
20 Feb 2016 06:43 PM
When a player joins the game they have a value within them called Hunger. Not their workspace player but the other one in the "Players" child under game. I need a simple script that will kill them if its value reaches 0.
Report Abuse
y1p is not online. y1p
Joined: 05 May 2013
Total Posts: 350
20 Feb 2016 06:45 PM
My bad i meant zero in the title not one.
Report Abuse
y1p is not online. y1p
Joined: 05 May 2013
Total Posts: 350
20 Feb 2016 06:48 PM
BUMP
Report Abuse
Fantasy is not online. Fantasy
Joined: 25 Oct 2007
Total Posts: 43
20 Feb 2016 06:52 PM
This is just a guess but something like this. (I am new to scripting) and I don't know where Hunger is located.

while true do
if game.Players.LocalPlayer.Character.Hunger.Value <= 0 then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
wait()
end
end
Report Abuse
y1p is not online. y1p
Joined: 05 May 2013
Total Posts: 350
20 Feb 2016 06:58 PM
bump
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
20 Feb 2016 07:08 PM
wait()

local Player = game.Players.LocalPlayer
local Hunger = Player.Character:FindFirstChild("Hunger")

Hunger.Changed:connect(function()
if Hunger.Value == 0 then
Player.Character:BreakJoints()
end
end)
Report Abuse
DevAlton is not online. DevAlton
Joined: 08 Dec 2014
Total Posts: 406
20 Feb 2016 07:09 PM
He gave you the answer.
Report Abuse
y1p is not online. y1p
Joined: 05 May 2013
Total Posts: 350
20 Feb 2016 07:18 PM
Not working
Report Abuse
y1p is not online. y1p
Joined: 05 May 2013
Total Posts: 350
20 Feb 2016 07:50 PM
bump
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