SHOW:
|
|
- or go back to the newest paste.
| 1 | local Player = game.Players.LocalPlayer | |
| 2 | local Character = Player.CharacterAdded:wait() | |
| 3 | local Mouse = Player:GetMouse() | |
| 4 | local Plane = workspace.Plane | |
| 5 | ||
| 6 | local Tool = script.Parent | |
| 7 | ||
| 8 | local equipped = false | |
| 9 | ||
| 10 | - | local BG = Plane.Engine.BodyGyro -- rotates the plane |
| 10 | + | local BG = Plane.Engine.zombieslayerwtf -- rotates the plane |
| 11 | - | local BV = Plane.Engine.BodyVelocity -- pushes the plane |
| 11 | + | local BV = Plane.Engine.zombieslayerwtf -- pushes the plane |
| 12 | ||
| 13 | local speed = 50 --The speed of the plane | |
| 14 | ||
| 15 | Tool.Equipped:connect(function() | |
| 16 | equipped = true | |
| 17 | BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge) | |
| 18 | ||
| 19 | repeat -- Continues to fly.. | |
| 20 | ||
| 21 | BV.velocity = Plane.Engine.CFrame.lookVector*speed -- Pushes the plane to it's new rotation | |
| 22 | BG.CFrame = CFrame.new(Plane.Engine.Position, Mouse.hit.p) -- Rotates the plane on the axis of the position and points at mouse | |
| 23 | wait() -- So we do not crash | |
| 24 | ||
| 25 | until not equipped -- until we unequip the tool. | |
| 26 | ||
| 27 | BV.MaxForce = Vector3.new(0,0, 0) -- Basically to cut of the "engine" | |
| 28 | BG.CFrame = CFrame.Angles(0,0,0) | |
| 29 | end) | |
| 30 | ||
| 31 | Tool.Unequipped:connect(function() -- Anonymous function | |
| 32 | equipped = false -- So we can tell when to stop flying the plane | |
| 33 | end) |