Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 03 May 2013 07:30 PM |
I have an idea what I did wrong, but not sure.
active = true
function Fire(player) if active == true then active = false if script.Parent:findFirstChild("Humanoid")then local Flame = Instance.new("Fire") Flame.Parent = player.Torso local smoke = Instance.new("Smoke") smoke.Parent = player.Torso local Char = script.Parent:findFirstChild("Humanoid") Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) smoke:remove() Flame:remove() wait(5) active = true end end end
script.Parent.Touched:connect(Fire)
When you step on the fire pit, you catch on fire. hehe. |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 03 May 2013 07:31 PM |
Okay this might be an error.
if script.Parent:findFirstChild("Humanoid")then
Forgot a space. |
|
|
| Report Abuse |
|
|
|
| 03 May 2013 07:33 PM |
| The last 'active=true' needs to go before the last 'end'. This will probably not fix it, but this will need to be done later on anyways. |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 03 May 2013 07:34 PM |
So far.
active = true
function Fire(player) if active == true then active = false if script.Parent:findFirstChild("Humanoid") then local Flame = Instance.new("Fire") Flame.Parent = player.Torso local smoke = Instance.new("Smoke") smoke.Parent = player.Torso local Char = script.Parent:findFirstChild("Humanoid") Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) Char.Health = Char.Health - 4 wait(1) smoke:remove() Flame:remove() wait(5) end end active = true end
script.Parent.Touched:connect(Fire) |
|
|
| Report Abuse |
|
|
| |
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
| |
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
| |
|
|
| 03 May 2013 07:48 PM |
omg1
local active={} script.Parent.Touched:connect(function(player) player=game:GetService'Players':GetPlayerFromCharacter(player.Parent) if player and not active[player.Name]then active[player.Name]=true Instance.new('Fire',player.Character:FindFirstChild'Torso') Instance.new('Smoke',player.Character:FindFirstChild'Torso') for i=1,5 do local Char = player.Character:FindFirstChild'Humanoid':TakeDamage(4) wait(1) end smoke:Destroy() Flame:Destroy() wait(5) active[player.Name]=false end end) |
|
|
| Report Abuse |
|
|
CokeCody
|
  |
| Joined: 31 Mar 2010 |
| Total Posts: 394 |
|
|
| 03 May 2013 07:52 PM |
local Active = false
function Fire(Hit) if Game.Players:GetPlayerFromCharacter(Hit.Parent) and not Active then Active = true local Fire = Instance.new("Fire", Hit.Parent.Torso) local Smoke = Instance.new("Smoke", Hit.Parent.Torso) for i = 1, 5 do local Humanoid = Hit.Parent:FindFirstChild("Humanoid") Humanoid.Health = Humanoid.Health - 4 wait(1) end Smoke:Destroy() Fire:Destroy() wait(5) Active = false end end
script.Parent.Touched:connect(Fire) |
|
|
| Report Abuse |
|
|