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

Script that makes smoke visible when touched certain brick????

Asked by 9 years ago

Basically, I've been working on a flight simulator and I would like my script to have my smoke visible when touched a certain brick, say...named...Runway1?????

This is the script I'm currently using

smk = script.Parent.Smoke


function onTouched()  

smk.Enabled = true
wait(3)
smk.Enabled = false
wait(0.1)

end


script.Parent.Touched:connect(onTouched)
0
Put your code in a code block by clicking the Lua button and pasting you code inside the block. It's more legible that way. Spongocardo 1991 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago

You'll want to add in an if statement to check the hit part's name.

smk = script.Parent.Smoke

function onTouched(hit)
    if hit.Name == "Runway1" then
        smk.Enabled = true
        wait(3)
        smk.Enabled = false
        wait(0.1)
    end
end

script.Parent.Touched:connect(onTouched)

0
I figured it out, thanks for the help tho :) MysticalMod 0 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Is the script located in the part that you want to have smoke on contact? If not, you should try it. It might help.

Answer this question