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

How Do I Make Something Active When A Certain Part Touches Another?

Asked by 6 years ago

I made a fire hydrant that has particles enabled when another part touches it. It works... here Ian the code.

local pem = script.Parent.ParticlEmitter
local mesh = script.Parent.MeshPart

pem.Enabled = false
local can = true

mesh.Touched:connect(function()
    if can == true then
        pem.Enabled = true
        can = false
        wait(5)
        pem.Enabled = false
    end
end)

I also made a gun using ROBLOX's Make a Raycasting Gun... It's on the WIKI. How do I make it so if that gun shoots the fire hydrant the touch is activated?

--Also known as how do I make a part that is created and destroyed within 0.2 of a second inside of a tool inside player activate an onTouched? Thank you!

Answer this question