generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Please debug this. [ Curious what I did wrong ]

Previous Thread :: Next Thread 
Xyaioh is not online. 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 is not online. 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
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
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 is not online. 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
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
03 May 2013 07:36 PM
Output, please?
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
03 May 2013 07:43 PM
Getting it..
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
03 May 2013 07:45 PM
Yeah no output.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image