local door = game.Workspace.SlideDoor local position = door.Position Y = 223.2 function closing() while Y >= 207.75 do wait(0.01) Y = Y - 0.05 position = CFrame.new(position.X,Y,position.Z) print(Y) end end script.Parent.ClickDetector.MouseClick:connect(closing)
I want the door to go down but it looks like something is wrong. Door wont move, but in the output i get correct number Y.
local door = game.Workspace.SlideDoor local position = door.Position Y = 223.2 function closing() while Y >= 207.75 do wait(0.01) Y = Y - 0.05 door.CFrame = CFrame.new(position.X,Y,position.Z) print(Y) end end script.Parent.ClickDetector.MouseClick:connect(closing)
i replaced a positon value with door.CFrame