How do i make a max limit of a part going up?

Hello!

  1. I am trying to make a system is if a part goes higher than the normal position it wont go up but if its lower it goes up

  2. I cant make a trigger for doing this

Any help is well thankful! Code is down below

local part = script.Parent

while true do
		wait(2)
		part.Position = part.Position + Vector3.new(0, 0.25, 0)
	end


I think you can simply do this

local part = script.Parent
local upVector = Vector3.new(0, 0.25, 0)

while true do
	wait(2)
	if part.Position.Y >= 180 then continue end
	part.Position += upVector
end

And all you have to do is change 180 to the maximum Y axis the part can reach before not being allowed to continue.

I think that’s what you want at least

thanks it worked for me (char limit)

1 Like

Anytime! if you have anymore issues don’t be afraid to make another post!