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

How do I add smoke in this slide door script?

Asked by 10 years ago

I made a slide door script where when you click it, it opens by sliding to the right (which you know). But I want the smoke with it to. Like movies, when they open something, smoke comes out and door opens. This is the script:

door = script.Parent.Parent.Door

function onClicked()
    for i = 1, 70 do
        door.CFrame = door.CFrame*CFrame.new(0.1, 0, 0)
        wait()
    end
    wait(3)
    for i = 1, 70 do
        door.CFrame = door.CFrame*CFrame.new(-0.1, 0, 0)
        wait()
    end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

2 answers

Log in to vote
0
Answered by 10 years ago

You can just do

door = script.Parent.Parent.Door
Instance.new("Smoke", door)
0
Wow. I should have known that. Lol. Thanks bro. User#5689 -1 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

I would suggest having an invisible, anchored, no collision part with a smoke object inside it with the enabled property set to false, then set that property to true when you want smoke and back to false when you don't. You can also edit the other properties of the smoke for the effect you want.

0
Alright. Thank you bro.\ User#5689 -1 — 10y
0
read my reply Operation_Meme 890 — 10y

Answer this question