Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Fire Upon Touching?

Asked by 10 years ago

I know this is probably a simple question, but I can't seem to figure it out. Essentially, I want your character to "catch fire" when you step on a fire. I know how to do the damage over time and all that stuff, but what I'm wondering is how to create a fire on the character's torso. Any help with this would be very much appreciated.

2 answers

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

Put this script in the block you want to catch players on fire:

script.Parent.Touched:connect(function(hit)
    if hit.Parent:firstFindChild("Humaniod") ~= nil and hit.Parent:firstFindChild("Torso") ~= nil then
        fire = Instance.new("Fire", hit.Parent.findFirstChild("Torso"))
    end
end)
Ad
Log in to vote
-1
Answered by 10 years ago

This might not work because I didn't test it

fire = game.Workspace.Part.Fire
part = game.Workspace.Part
plr = game.Workspace.LocalPlayer

function onTouched(hit)
    if plr:onTouched(Part) then
        game.Workspace.plr:GetPlayers("Torso")
        plr.Torso.Fire.Enabled = false
    end
end

script.Parent.Touched:connect(onTouched)

Answer this question