CrossArms
|
  |
| Joined: 27 Feb 2011 |
| Total Posts: 2654 |
|
| |
|
|
| 16 Jan 2012 01:38 AM |
Not exactly sure but
"function onTouch(toucher)
game.Workspace.toucher.Health = game.Workspace.toucher.Health +50 Script.parent.BrickColor = BrickColor.new("Black") wait(10) Script.parent.BrickColor = BrickColor.new("Lime green") Script.Parent.Touched:connect(onTouched) end "
That probably has something worg with it aswell :c
|
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 16 Jan 2012 01:38 AM |
well for one, the connector is wrong, it should go after the end, the "toucher" part is wrong as well, if a random brick touches it, it doens't have the Health value so it won't work.
what are you trying to do? |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 01:41 AM |
debounce = false thing = game.Workspace.toucher function onTouch(toucher) if debounce == false and game.Players:GetPlayerFromCharacter(toucher.Parent) then debounce = true thing.Humanoid.Health = thing.Humanoid.Health + 50 --I added "humanoid" I think that's what you wanted script.Parent.BrickColor = BrickColor.new("Black") wait(10) script.Parent.BrickColor = BrickColor.new("Lime green") debounce = false end end script.Parent.Touched:connect(onTouched)
Try that
|
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 01:41 AM |
wait no
function onTouch(toucher)
if toucher.Parent:FindFirstChild("Humanoid") then
toucher.Parent.Humanoid.Health = toucher.Parent.Humanoid.Health + 50 Script.parent.BrickColor = BrickColor.new("Black") wait(10) Script.parent.BrickColor = BrickColor.new("Lime green") Script.Parent.Touched:connect(onTouched) end
Lol Made a major mistake in the last one. |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 16 Jan 2012 01:42 AM |
@thunder
i think "toucher" is the thing that activates the onTouch script, so you shouldn't define it in a variable |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 02:09 AM |
Why make it so difficult?
script.Parent.Touched:connect(function(toucher) if toucher and toucher.Parent:FindFirstChild("Humanoid") then toucher.Parent.Humanoid.Health = toucher.Parent.Humanoid.Health + 50 script.Parent.BrickColor = BrickColor.new("Black") wait(10) script.Parent.BrickColor = BrickColor.new("Lime green") end end) |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 02:54 AM |
| it's funny how only 2 people who fix'd this put connection lines. |
|
|
| Report Abuse |
|
|