|
| 30 Jul 2013 10:31 PM |
Tonight is my first night of scripting. I'm really hope to make some scripts. Currently, I'm trying to make a script that if a player steps on a brick it heals him 25 health. This is the script I'm using currently using, which damages the player. (I do not know if I can basically reverse the script, so do not call me a "noob" please.)
function onTouched(hit) local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then human.Health= 75 end end
script.Parent.Touched:connect(onTouched)
Is there any way I could make this scripts able to heal, or do I have to make a new script? Please help. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:32 PM |
| human.Health = human.Health + 25 |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:32 PM |
noob
/GPmOcBT | http://www.roblox.com/Forum/ShowPost.aspx?PostID=107601546 |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:32 PM |
| Thank you, Cody. I am trying it right now. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:38 PM |
| First night and working on functions.No no no Wiki time or LuaLearners |
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 30 Jul 2013 10:40 PM |
| 1 month on roblox and already scripting. :0 It took me like a year to start. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:41 PM |
| I tried using that on the script. It didn't work, when I replaced the damage with the healing. Am I doing it wrong? |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:42 PM |
| Oh, okay. I got distracted while replying and didn't the other replies. |
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 30 Jul 2013 10:52 PM |
function onTouched(hit) local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then human.Health = human.Health + 25 end end
|
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 10:56 PM |
I tried that, it didn't work. I'll just figure it out in the morning. Thanks for the help, though.
|
|
|
| Report Abuse |
|
|