This is a model script and i want the model to move slowly upwards and i also want it to play a sound (only once) when the button is pressed.
Any help?
01 | local model = game.Workspace [ "Door4" ] ; -- The model you want to move up |
02 | local increment = 0.5 --The amount you want it to go up by each time |
03 | local max = 10 --The studs you want to go up by |
04 | local Button = script.Parent.ClickDetector --Change this to the ClickDetector. |
05 | local closed = true |
06 | local isMoving = false |
07 |
08 | function onClick() |
09 | if isMoving = = false then |
10 | isMoving = true |
11 | if closed then |
12 | move = increment |
13 | else |
14 | move = -increment |
15 | end |