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: Simple Problem

Previous Thread :: Next Thread 
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
25 Mar 2012 03:14 PM
function onTouched(part)
local h = part.Parent:findFirstChild("Health")
if h~=nil then
h.Value = h.Value -10
end
end
script.Parent.Back.Touched:connect(onTouched)

I have no idea why it doesnt work, I originaly had the "Health" set to NumberValue as it looks for a NumberValue in the brick.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
25 Mar 2012 03:21 PM
local h = part.Parent:findFirstChild("Humanoid")

then

h.Health = h.Health -10
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
25 Mar 2012 03:25 PM
I'm not trying to make it to kill a person, I want it to take 10 away from the Value I added to the brick.

"One cannot prevent war, only particapate in it."
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
25 Mar 2012 03:32 PM
add a debounce
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
25 Mar 2012 04:07 PM
Nah, I already fixed the problem.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
25 Mar 2012 04:32 PM
cool
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