Your IF statement is correct, but, unfortunately, when you're lowering the scale, it won't low .01 a time, it would low 0.0100000(something). So it will NEVER reach zero.
So where you have
if script.Parent.Part.Mesh.Scale == Vector3.new(0, 0, 0) then
You should have
if script.Parent.Part.Mesh.Scale <= Vector3.new(0, 0, 0) then
So, it will break the script when the scale is equal or lower than ZERO.
But it would leave a little mesh. So, after the loop. it's time to set the scale to zero.
script.Parent.Part.Mesh.Scale = Vector3.new(0, 0, 0)
Rewritten script
while true do
script.Parent.Part.Mesh.Scale = script.Parent.Part.Mesh.Scale - Vector3.new(.01, .01, .01)
wait(.1)
if script.Parent.Part.Mesh.Scale <= Vector3.new(0, 0, 0) then
break
end
end
script.Parent.Part.Mesh.Scale = Vector3.new(0,0,0)
But this script doesn't work. I had made changes to it
while script.Parent.Part.Mesh.Scale.X > 0 and script.Parent.Part.Mesh.Scale.Y > 0 and script.Parent.Part.Mesh.Scale.Z > 0 do
script.Parent.Part.Mesh.Scale = script.Parent.Part.Mesh.Scale - Vector3.new(.003,.003,.003)
wait()
end
script.Parent.Part.Mesh.Scale = Vector3.new(0,0,0)
1 comment
have you used the
forloop?