I was trying to script a looping idle movement for my new staff member, but the debugger says that one of the functions is unknown. I needed a wait function to spread out the movement, so that may be the problem, but i got that function from a website. Would someone mind checking this code for me and maybe revising it?
Code: Select all
function Create()
Object.ApplyVelocity(1, 0, false)
Turn1 = true
end
if Turn1 = true then
function Wait(2)
Object.ApplyVelocity(0, 0, false)
Turn2 = true
end
if Turn2 = true then
function Wait(2)
Object.ApplyVelocity(-1, 1, false)
Turn3 = true
Turn1 = false
end
if Turn3 = true then
function Wait(2)
Object.ApplyVelocity(0, 0, false)
Turn4 = true
Turn2 = false
end
if Turn4 = true then
function Wait(2)
Object.ApplyVelocity(0, 1, false)
Turn5 = true
Turn3 = false
end
if Turn5 = true then
function Wait(2)
Object.ApplyVelocity(0, 0, false)
Turn6 = true
Turn4 = false
end
if Turn6 = true then
function Update(timePassed)
Object.ApplyVelocity(1, 0, false)
function Wait(2)
Turn1 = true
Turn5 = false
endThe "Turn1-6" are variables to set when the object will apply that new velocity
The last one is an update function because i needed that to loop it back around.
The function Wait(2) is supposed to make to script stop for 2 seconds and then continue on, so its not a jerky movement.






