Hello, why is this script not working? It is meant to check that if a part collides, and that if the Damage bool value is true, and if the Part is not anchored, it turns lime green, fades, and then gets destroyed...
(This is for a part which rises like a flood)
When I run the script, the part rises like normal, and no parts get destroyed. I checked, there are no errors.
function onTouched(part)
if script.Parent.Configure.Damage.Value == true then
if part.Anchored ~= true then
part.BrickColor = part.BrickColor.new("Lime green")
wait(1)
part.Transparency = 0.1
wait(0.5)
part.Transparency = 0.2
wait(0.5)
part.Transparency = 0.3
wait(0.5)
part.Transparency = 0.4
wait(0.5)
part.Transparency = 0.5
wait(0.5)
part:BreakJoints()
part.Transparency = 0.6
wait(0.5)
part.Transparency = 0.7
wait(0.5)
part.Transparency = 0.8
wait(0.5)
part.Transparency = 0.9
wait(0.5)
part.Transparency = 1
wait(0.5)
part:Destroy()
end
end
end

2 comments
Did you include the whole script in this code block above? If so, then you never even called the function.
Nevermind. It's fixed.