Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var rotation = game.getGameplayCamRot(0);
- var position = flying.position;
- var direction = one_utils.rotationToDirection(rotation);
- var xMagnitude = game.getDisabledControlNormal(0, 1);
- var yMagnitude = game.getDisabledControlNormal(0, 2);
- var speed = 1;
- if(!one_utils.getKeysDisabled()) {
- if(one_utils.getKeyState(16) == "down") {
- speed = 3;
- } else if(one_utils.getKeyState(18) == "down") {
- speed = 0.5;
- }
- if(one_utils.getKeyState(0x53) == "down") {
- position.x = position.x - (direction.x * speed);
- position.y = position.y - (direction.y * speed);
- position.z = position.z - (direction.z * speed);
- }
- if(one_utils.getKeyState(0x57) == "down") {
- position.x = position.x + (direction.x * speed);
- position.y = position.y + (direction.y * speed);
- position.z = position.z + (direction.z * speed);
- }
- if(one_utils.getKeyState(0x41) == "down") {
- position.x = position.x + (-direction.y * speed);
- position.y = position.y + (direction.x * speed);
- }
- if(one_utils.getKeyState(0x44) == "down") {
- position.x = position.x - (-direction.y * speed);
- position.y = position.y - (direction.x * speed);
- }
- if(xMagnitude !== 0) {
- rotation.z = rotation.z + (-xMagnitude) * (speed * 10);
- }
- }
- flying.position = position;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement