I’m making a space rocket for my friend, when a bool value is on then the engines are meant go on, but its not working. help would be great.
if script.Parent.Parent.Parent.ON.Value == true then
--script.Parent.Parent.Parent is the model in which the value is located in.
script.Parent.Exhaust.Enabled = true
wait(4)
script.Parent.Exhaust.Enabled = false
wait(1)
script.Parent.Flame2.Enabled = true
script.Parent.ParticleEmitter.Enabled = true
end
I might need more of the Hierarchy, I can see script’s parent but not it’s parent and it’s parent’s parent
EDIT: Also, for easier usage, just name your variables (like local engine = script.Parent; local … = engine.Parent and so on)
So is the first section of code inside a loop or a function? If it isn’t then it only runs once.
Try putting that section inside the clickdetector section of script so if fires each time the clickdetector fires.