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

How do I create fire on touch?

Asked by 2 years ago

How can I create fire on a part after someone steps on it?

2 answers

Log in to vote
1
Answered by
bbissell 346 Moderation Voter
2 years ago
Edited 2 years ago

You can create a script inside of the part that will do this. It's pretty simple! First you want to make sure the part is actually touched by a humanoid, then you create a fire on the part. Here is the code:

local PlayersService = game:GetService("Players")

local debounce = false

script.Parent.Touched:Connect(function (hit)
    if hit and hit.Parent:FindFirstChild("Humanoid") and PlayersService:GetPlayerFromCharacter(hit.Parent) and debounce == false then
        local fire = Instance.new("Fire")
        fire.Parent = script.Parent
        debounce = true
        wait(1)
        debounce = false
    end
end)
1
that's what I was looking for. Thanks! duckhunter392 25 — 2y
Ad
Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

Answer this question