Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to remove Fire from a player?

Hey there, New scripter here.

I made this script when Touched the player goes on fire, However i'm trying to make the Fire disappear after a wait(5) put doesn't seem to be working?

Any ideas?

function lightOnFire(part)
	
	fire = Instance.new("Fire")
	fire.Parent = part
end
 
firePart = game.Workspace.FirePart
firePart.Touched:Connect(lightOnFire)

wait(5)
fire:Destroy()

Thanks,

2 answers

The other answer got downvoted so I assume it didn't work. Try this.

game.Workspace.FirePart.Touched:Connect(function(part)
	local fire = Instance.new("Fire")
	fire.Parent = part

	local Debris = game:GetService("Debris"):AddItem(fire, 5)
end)

Sup, i'm BashGuy10. I can help ye :)

Problem?

You can't remove the fire from the part.

Fixes

You should use:

firepart.Touched:Connect(function(part)
	-- Code
end)

Also, use the wait() and :Destroy() actions inside the Touched Event

Example Fix for Problem 2

firepart.Touched:Connect(function(part)
	-- Instance.new code here

	wait(5)
	fire:Destroy()
end)

Here have the answer since it is kinda confusing to you(btw im pretty sure your not allowed to spoon feed answers like MachoPiggies did)

local firepart = script.Parent

fire.Touched:Connect(function(part)
	local fire = Instance.new("Fire", workspace)

	wait(5)
	fire:Destroy()
end

2 comments

0

AW COME ON, who downvoted. I just got that 2 rep back (insert sad emoji here)

0

@BashGuy10 That didn't quite seem to work?, Im not totally sure what im meant to replace in my previous code

This discussion is preserved as it was. New answers, comments, and votes are closed.