Hi, I made a script to resize a part and move another part, the problem I'm having is the part won't stop moving even though I've coded it to stop when the Position is at a certain Position, and yet the part still carries on Moving even after it's reached the position.
Here is the script:
local MDoor = script.Parent local handle = script.Parent.Parent.Handle game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "Open Door" then repeat MDoor:Resize(Enum.NormalId.Bottom,- 0.5) wait(0.2) until MDoor.Size.y <= 1 end repeat wait(0.2) handle.Position = handle.Position + Vector3.new(0, 0.7, 0) until handle.Position.y == 17 end) end)
I tried using "MoveTo" but it didn't seem to work.
Any sort of help is greatly appreciated, Thanks.
You are increasing the position by 0.7 and that won't evenly add up to 17. Instead adjust it so it's more even or use
until handle.Position.y >= 17
Which means stop if it's position is equal to or greater than 17.