|
| 11 Mar 2012 05:15 PM |
| For instance, I want to be able to make something happen to a player when he touches a brick and has a health of less then 10... how could I accomplish this? |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 11 Mar 2012 05:16 PM |
if [However you get to the character].Humanoid.Health <= Number then ... end |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2012 05:20 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then if hit.Parent:findFirstChild("Humanoid").Health < 10 then hit:Destroy() end end end) |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2012 05:21 PM |
| Dang it. Hate doin this on an iPad. |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2012 05:33 PM |
script.Parent.Touched:connect(becky) b = becky.Parent:findFirstChild("Humanoid") if b ~= nil then -- If b is not equal to nothing b:TakeDamage(100) end end)
|
|
|
| Report Abuse |
|
|
|
| 11 Mar 2012 05:45 PM |
Oh wait nvm hold on:
script.Parent.Touched:connect(becky) b = becky.Parent:findFirstChild("Humanoid") if b ~= nil then m = Instance.new("Message", workspace) m.Text = "Who ever touched me's health is " .. b.Health wait(5) m:remove() end end) |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2012 05:51 PM |
| fix script.Parent.Touched:connect(becky) to script.Parent.Touched:connect(function(becky) |
|
|
| Report Abuse |
|
|