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

How do I trigger an object at a certain time?

Asked by 4 years ago

I'm planning on making a roller coaster. Make it fully functional and really adventurous. But the thing that always gets me is, how do I make an object appear at a certain time? Maybe like a fire emitter happens at a certain time, or a humanoid appear out of nowhere. How could I make that happen?

0
Maybe place a part so when the roller coaster touches it starts a timer and when the wait() ends Fire appears LaysCo 61 — 4y

1 answer

Log in to vote
0
Answered by
LaysCo 61
4 years ago
Edited 4 years ago

Add part on your roller coaster track i assume and add a part to the coaster so when the coaster touches the part it will start the timer "Name it whatever you want be sure to change "coaster" text

local db = false
local enabled = 5 -- when the part appears
local disabled = 5 --when the part disappears

script.Parent.Touched:Connect(function(tuch) --detects what touched part
    if tuch.Name == "coaster" and db == false then --detects the name
        db = true
            local Flame = game.Workspace.CS.Fire --location of fire or part
        wait(enabled)
            Flame.Enabled = true
        db = false
        wait(disabled)
        Flame.Enabled = false
    end
end)
Ad

Answer this question