Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mouse = game.Players.LocalPlayer:GetMouse()
- mouse.KeyDown:connect(function(k)
- local key = k:lower()
- if key == "z"then
- print("ga")
- local torso = mouse.Target
- --fly------------------------------------------------
- -- cam manipulation
- local target = mouse.Target
- local camera = workspace.CurrentCamera
- camera.CameraType = Enum.CameraType.Follow
- camera.CameraSubject = target
- --cam manipulation2
- game:GetService('RunService').Stepped:connect(function()
- torso.CanCollide = false
- end)
- local powers = 99
- local bambam = Instance.new("BodyThrust")
- bambam.Parent = torso
- bambam.Force = Vector3.new(powers,0,powers)
- bambam.Location = torso.Position-Vector3.new(0,0,50)
- local plr = game.Players.LocalPlayer
- local torso = mouse.Target
- local flying = true
- local deb = true
- local ctrl = {f = 0, b = 0, l = 0, r = 0}
- local lastctrl = {f = 0, b = 0, l = 0, r = 0}
- local maxspeed = 4000
- local speed = 0
- function Fly()
- local bv = Instance.new("BodyVelocity", torso)
- bv.velocity = Vector3.new(0,0,0)
- bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
- repeat wait()
- if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
- speed = speed+.5+(speed/maxspeed)
- if speed > maxspeed then
- speed = maxspeed
- end
- elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
- speed = speed-1
- if speed < 0 then
- speed = 0
- end
- end
- if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
- bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
- lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
- elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
- bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
- else
- bv.velocity = Vector3.new(0,0.1,0)
- end
- until not flying
- ctrl = {f = 0, b = 0, l = 0, r = 0}
- lastctrl = {f = 0, b = 0, l = 0, r = 0}
- speed = 0
- bv:Destroy()
- end
- mouse.KeyDown:connect(function(key)
- if key:lower() == "e" then
- if flying then flying = false
- else
- flying = true
- Fly()
- end
- elseif key:lower() == "w" then
- ctrl.f = 1
- elseif key:lower() == "s" then
- ctrl.b = -1
- elseif key:lower() == "a" then
- ctrl.l = -1
- elseif key:lower() == "d" then
- ctrl.r = 1
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key:lower() == "w" then
- ctrl.f = 0
- elseif key:lower() == "s" then
- ctrl.b = 0
- elseif key:lower() == "a" then
- ctrl.l = 0
- elseif key:lower() == "d" then
- ctrl.r = 0
- end
- end)
- Fly()
- --fly
- end
- local hum = game.Players.LocalPlayer.Character.HumanoidRootPart
- if key == "x" then
- if mouse.Target then
- hum.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y + 5, mouse.Hit.z)
- end
- end
- if key == "q" then
- local target = game.Players.LocalPlayer.Character.Head
- local camera = workspace.CurrentCamera
- camera.CameraType = Enum.CameraType.Follow
- camera.CameraSubject = target
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement