This is my script and I need help on fixing it:

Elevator.Touched:Connect(function(hit)

local Elevator = script.Parent --anchor this part

local dir = 1

local max_val = 25 --goes to this value

local min_val = -25 --comes back to this value

local wait_time = 0.1 --small number = faster

while true do Elevator.Position = Elevator.Position + Vector3.new(0,1,0) wait(wait_time)

if (Elevator.Position.Y > max_val) then 
	dir = -1
end

if (Elevator.Position.Y < min_val) then
	dir = 1
end

end

1 comment

0

be more specific lol idk what you are stuck on plus u forgot an ")" at the very (last) "end" (get it, pun intended)