Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Forward = {x=1,y=0,z=0}
- function shift(direction)
- if direction=="right" then
- print("shifting direction right")
- if Forward.x==1 then
- Forward.x=0
- Forward.z=1
- elseif Forward.z==1 then
- Forward.x=-1
- Forward.z=0
- elseif Forward.x==-1 then
- Forward.x=0
- Forward.z=-1
- elseif Forward.z==-1 then
- Forward.z=0
- Forward.x=1
- end
- end
- if direction=="left" then
- print("shifting direction left")
- if Forward.x==1 then
- Forward.x=0
- Forward.z=-1
- elseif Forward.z==-1 then
- Forward.x=-1
- Forward.z=0
- elseif Forward.x==-1 then
- Forward.x=0
- Forward.z=1
- elseif Forward.z==1 then
- Forward.z=0
- Forward.x=1
- end
- end
- end
- for i = 1,20 do
- print("Forward")
- for i,v in pairs(Forward) do
- print(i.."="..v)
- end
- shift("right")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement