|
| 27 Apr 2012 04:14 PM |
function onTouched(hit) local h = Game.Workspace:findFirstChild("Humanoid") if h~=nil then h.Health = h.Health -50 end end
script.Parent.Touched:connect(onTouched)
It's inside a brick, which is in the Workspace. [ Of course. ] When you touch the brick, it's supposed to subtract 50 health from ALL players.
But.. It doesn't work. Why? |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2012 04:19 PM |
Bump.
And yes, it is an edited free model.
Hooray, silent judging. :\ |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2012 04:29 PM |
function onTouched(hit) local h = (game.Players:GetPlayers()) if h~=nil then h.Humanoid.Health = h.Humanoid.Health -50 end end
script.Parent.Touched:connect(onTouched)
Would this work? |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2012 04:35 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid:TakeDamage(50) end end) |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2012 04:36 PM |
| EVERYONE IG has to take damage. |
|
|
| Report Abuse |
|
|
gamehero
|
  |
| Joined: 12 Jun 2007 |
| Total Posts: 1455 |
|
|
| 27 Apr 2012 04:41 PM |
Here. This should work..
script.Parent.Touched:connect(function(hit) p = game.Players:GetPlayers() for i=1,#p do char = p[i].Character if char ~= nil then h = char:findFirstChild("Humanoid") if h ~= nil then h:TakeDamage(50) end end end end) |
|
|
| Report Abuse |
|
|
| |
|