plytalent

fly local

Oct 4th, 2020 (edited)
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local plrs = game:GetService("Players")
  2. local plr = plrs.LocalPlayer
  3. local character = plr.Character
  4. local upordownorstable=-3.5
  5. local MANAFLY
  6. local mouse = plr:GetMouse()
  7. local harp={Up="x",Down="z"}
  8. local Ui
  9. local MANAFLY_EVENT
  10. local function keydown(k)
  11.     if k == harp["Up"] then
  12.         upordownorstable = upordownorstable+3
  13.     elseif k == harp["Down"] then
  14.         upordownorstable = upordownorstable-3
  15.     end
  16. end
  17. local function keyup(k)
  18.     if harp["Up"] then
  19.         upordownorstable = -3.5
  20.     elseif k == harp["Down"] then
  21.         upordownorstable = -3.5
  22.     end
  23. end
  24. local mousekeyevent = {down=mouse.KeyDown:Connect(keydown),up = mouse.KeyUp:Connect(keyup)}
  25. game:GetService("RunService"):BindToRenderStep("HARP MANAFLY IN GAIA",1,function()
  26.     coroutine.resume(coroutine.create(function()
  27.         if not MANAFLY then
  28.             MANAFLY =  Instance.new("Part")
  29.         end
  30.         MANAFLY.Parent = workspace
  31.         MANAFLY.Size = Vector3.new(2,1,2)
  32.         MANAFLY.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,upordownorstable,0)
  33.         MANAFLY.Name = "MANAFLYPART"
  34.         MANAFLY.Anchored = true
  35.         if not MANAFLY_EVENT then
  36.         MANAFLY_EVENT =MANAFLY.Touched:Connect(function(hit)
  37. --              print("Event Touched From ",v.Name)
  38.                 local a
  39.                 if not MANAFLY:FindFirstChild("NoCollisionConstraint")  then
  40.                     a=Instance.new("NoCollisionConstraint",MANAFLY)
  41.                     a.Name = "NoCollisionConstraint"
  42.                 elseif MANAFLY:FindFirstChild("NoCollisionConstraint") then
  43.                     a=MANAFLY:FindFirstChild("NoCollisionConstraint")
  44.                 end
  45.                 if hit.Parent ~= plr.Character then
  46.                     a.Part0=MANAFLY
  47.                     a.Part1=hit
  48.                 end
  49.             end)
  50.         end
  51.     end))
  52.     coroutine.resume(coroutine.create(function()
  53.         if not Ui then
  54.             Ui = Instance.new("Frame",Instance.new("ScreenGui",plr.PlayerGui))
  55.             local ButtonSubmit = Instance.new("TextButton",Ui)
  56.             local Up = Instance.new("TextBox",Ui)
  57.             local Down = Instance.new("TextBox",Ui)
  58.             local Key1 = Instance.new("TextLabel",Ui)
  59.             local Key2 = Instance.new("TextLabel",Ui)
  60.  
  61.             Ui.Position= UDim2.new(0.89, 0, 0.5, 0)
  62.             Ui.Size = UDim2.new(0.11, 0, 0.25, 0)
  63.             Ui.BorderSizePixel = 0
  64.  
  65.             ButtonSubmit.Size = UDim2.new(1, 0, 0.2, 0)
  66.             ButtonSubmit.Text = "SUBMIT"
  67.  
  68.             Key1.Position = UDim2.new(0, 0, 0.199, 0)
  69.             Key1.Size = UDim2.new(1, 0, 0.2, 0)
  70.             Key1.Text = "KEY UP"
  71.  
  72.             Up.Position = UDim2.new(0, 0, 0.397, 0)
  73.             Up.Size  = UDim2.new(1, 0, 0.2, 0)
  74.  
  75.             Key2.Position = UDim2.new(0, 0, 0.589, 0)
  76.             Key2.Size = UDim2.new(1, 0, 0.2, 0)
  77.             Key2.Text = "KEY DOWN"
  78.  
  79.             Down.Position = UDim2.new(0, 0, 0.795, 0)
  80.             Down.Size  = UDim2.new(1, 0, 0.2, 0)
  81.  
  82.             ButtonSubmit.MouseButton1Click:Connect(function()
  83.                 if Up.Text ~= "" or Up.Text ~= " " then
  84.                     harp["Up"]=Up.Text
  85.                     mousekeyevent.up:Disconnect()
  86.                     mousekeyevent.down:Disconnect()
  87.                     mousekeyevent = {down=mouse.KeyDown:Connect(keydown),up = mouse.KeyUp:Connect(keyup)}
  88.                 else
  89.                     harp["Up"]="q"
  90.                     mousekeyevent.up:Disconnect()
  91.                     mousekeyevent.down:Disconnect()
  92.                     mousekeyevent = {down=mouse.KeyDown:Connect(keydown),up = mouse.KeyUp:Connect(keyup)}
  93.                 end
  94.                 if Down.Text ~= "" or Down.Text ~= " " then
  95.                     harp["Down"]=Down.Text
  96.                     mousekeyevent.up:Disconnect()
  97.                     mousekeyevent.down:Disconnect()
  98.                     mousekeyevent = {down=mouse.KeyDown:Connect(keydown),up = mouse.KeyUp:Connect(keyup)}
  99.                 else
  100.                     harp["Up"]="e"
  101.                     mousekeyevent.up:Disconnect()
  102.                     mousekeyevent.down:Disconnect()
  103.                     mousekeyevent = {down=mouse.KeyDown:Connect(keydown),up = mouse.KeyUp:Connect(keyup)}
  104.                 end
  105.             end)
  106.         end
  107.     end))
  108. end)
Add Comment
Please, Sign In to add comment