I tried making a script where a part rises once clicked and it rises until a certain point, but when testing, it keeps rising on and on. Is there a way to make it stop once it is the same position on the y-axis?
local clickdetector = script.Parent
local part = workspace.Mark3
clickdetector.MouseClick:Connect(function()
repeat
wait(0)
for i = 1, 1 do
part.CFrame = part.CFrame * CFrame.new(0,0.1,0)
end
until part.Position.Y == workspace.Mark1.Position.Y
end)

4 comments
use tweenservice
oh ok
or lerp the cframe
Or you could just use a >= lol