I made this script where when you click the window it moves. How can I fix this?
Okay, I made this script where when you click the window it moves upward or downward depending on it's position, and it doesn't work. The Output said "Unable to cast instance to CoordinateFrame"
Here is the script:
01 | local part = script.Parent |
02 | local detector = part:WaitForChild( "ClickDetector" ) |
04 | local one = script.Parent.Parent:WaitForChild( "LerpTo1" ) |
05 | local two = script.Parent.Parent:WaitForChild( "LerpTo2" ) |
07 | detector.MouseClick:Connect( function () |
08 | if opened = = false then |
11 | part.CFrame = part.CFrame:Lerp(one, i) |
17 | part.CFrame = part.CFrame:Lerp(two, i) |