|
| 23 Feb 2013 02:12 PM |
I'm making a script for a model to do something special:
when you walk on the black (Vent) block,the block turns red and fire comes out. Then the block kills you.
here's the script:
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then script.Parent.BrickColor = BrickColor.new("Bright red") Feuer = instance.new("Fire",script.Parent) Feuer.Size = 2 Feuer.Heat = 4 humanoid.Health = 0 wait (1) script.Parent.BrickColor = BrickColor.new("Mid gray") Feuer:remove() end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 23 Feb 2013 02:40 PM |
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then script.Parent.BrickColor = BrickColor.new("Bright red") Feuer = Instance.new("Fire",script.Parent) Feuer.Size = 2 Feuer.Heat = 4 humanoid.Health = 0 wait (1) script.Parent.BrickColor = BrickColor.new("Mid gray") Feuer:remove() end end
script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
|
| 24 Feb 2013 09:48 PM |
While that, I already found a method to make the fire come out. here it is:
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then script.Parent.BrickColor =BrickColor.new("Bright red") script.Parent.Fire.Enabled = true humanoid.Health = 0 wait(1) script.Parent.BrickColor = BrickColor.new("Mid gray") script.Parent.Fire.Enabled = false end end |
|
|
| Report Abuse |
|
|