Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

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.

2 answers

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)

1 comment

0

I figured it out, thanks for the help tho :)

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

This discussion is preserved as it was. New answers, comments, and votes are closed.