i have a part that’s slowly and constantly growing in size, and i want to set the size back to the original if it ever grows more that that. i’m wondering why my script doesn’t work.
extreme beginner warning:
local o2 = script.Parent
while true do
wait(0.2)
if o2.Size >= Vector3.new(0.25, 3.972, 0.5) then
o2.Size = Vector3.new(0.25, 3.972, 0.5)
end
end
I think the problem is in your if statement. I’m not sure if you can compare vectors like that.
Assuming your part grows equally in size in all directions, try this:
local o2 = script.Parent
while true do
task.wait(0.2)
if o2.Size.X > 0.25 or o2.Size.Y > 3.972 or o2.Size.Z > 0.5 then
o2.Size = Vector3.new(0.25, 3.972, 0.5)
end
end