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: Very Super Easy Script Fix.HELP!ME!

Previous Thread :: Next Thread 
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
20 Jan 2013 11:19 AM
Just fix this script its broken... I want it to loose health when a brick touches it. I made it so it looses all health. cant figure out how to make it loose 1 health...



function onTouch(part)
script.Parent.Parent.Humanoid.Health - 1
end
script.Parent.Touched:connect (onTouch)
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
20 Jan 2013 11:22 AM
local db = true
script.Parent.Touched:connect(function(hit)
if not hit.Parent:findFirstChild("Humanoid") and db then
db = false
print("not hit by a player")
script.Parent.Parent.Humanoid.Health = script.Parent.Parent.Humanoid.Health - 1 --idk that you have this pointing to the correct location
end
end)
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
20 Jan 2013 11:23 AM
local db = true
script.Parent.Touched:connect(function(hit)
if not hit.Parent:findFirstChild("Humanoid") and db then
db = false
print("not hit by a player")
script.Parent.Parent.Humanoid.Health:TakeDamage(1) --idk that you have this pointing to the correct location
wait(1)
db = false
end
end)
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
20 Jan 2013 11:29 AM
Not a lava script............


I have a humanoid called monkey home and i want it to loose health when any old brick touches it. Thats why the script i had before was so simple. i
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
20 Jan 2013 11:30 AM
ik that's why I made it so when a player touches it, nothing happens.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
20 Jan 2013 11:35 AM
how could you go from this


function onTouch(part)
script.Parent.Parent.Humanoid.Health = 0
end
script.Parent.Touched:connect (onTouch)


to that?


The script above works i just want it to - 1 health. ill use urs and test it.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
20 Jan 2013 11:36 AM
script.Parent.Parent.Humanoid.Health = script.Parent.Parent.Humanoid.Health - 1

Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
20 Jan 2013 11:39 AM
Thanks!
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