Advertisement
SxScripting

FireFlight Local Script

Jul 24th, 2022
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer.Character
  2.  
  3. local Player = game.Players.LocalPlayer
  4. local UIS = game:GetService("UserInputService")
  5. local RunService = game:GetService("RunService")
  6. local CraterEffect = require(game.ReplicatedStorage.CraterEffects)
  7. local Character = game.Players.LocalPlayer.Character
  8. local Humanoid = Character.Humanoid
  9. local Animation = Humanoid:LoadAnimation(script.Idle)
  10. local FlyAnimation = Humanoid:LoadAnimation(script.Flight)
  11. local Camera = game.Workspace.CurrentCamera
  12. local Debs = {false,false}
  13.  
  14. local BodyGyro = Instance.new("BodyGyro")
  15. local BodyVelo = Instance.new("BodyVelocity")
  16. local Speed = 145
  17.  
  18. local Param = RaycastParams.new()
  19. Param.FilterDescendantsInstances = {Character}
  20. Param.FilterType = Enum.RaycastFilterType.Blacklist
  21.  
  22. local function SPEED(Walk,Jump,Anchored)
  23. Humanoid.WalkSpeed = Walk
  24. Humanoid.JumpPower = Jump
  25. Character.HumanoidRootPart.Anchored = Anchored
  26. end
  27.  
  28. UIS.InputBegan:Connect(function(Input,IsTyping)
  29. if IsTyping then return end
  30. if Input.KeyCode == Enum.KeyCode.E then
  31. if Debs[1] then
  32. game.ReplicatedStorage.getFireTrans:FireServer()
  33. Debs[1] = false
  34. else
  35. SPEED(0,0,true)
  36. Animation:Play()
  37. game.ReplicatedStorage.getFireTrans:FireServer()
  38. Debs[1] = true
  39. end
  40. end
  41. end)
  42.  
  43. UIS.InputEnded:Connect(function(Input,IsTyping)
  44. if IsTyping then return end
  45. if Input.KeyCode == Enum.KeyCode.E then
  46. CraterEffect.new(
  47. 'Crater', -- This is the type of effect you want
  48. Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
  49. {
  50. ['BlockSize'] = {2,4};
  51. ['AnimationSpeed'] = .2;
  52. ['PartCount'] = 15;
  53. ['Radius'] = 15;
  54. ['Angle'] = 65;
  55. ["HoldTime"] = 8;
  56. }
  57. )
  58. SPEED(16,50,false)
  59.  
  60. if not Debs[2] then
  61. FlyAnimation:Play()
  62. Debs[2] = true
  63. else
  64. FlyAnimation:Stop()
  65. Debs[2] = false
  66. end
  67. Animation:Stop()
  68. BodyVelo.Parent = Character.HumanoidRootPart
  69. BodyGyro.Parent = Character.HumanoidRootPart
  70. end
  71. end)
  72.  
  73. RunService.RenderStepped:Connect(function()
  74. if Debs[2] then
  75. BodyGyro.MaxTorque = Vector3.new(0,400000,0)
  76. BodyGyro.D = 100
  77. BodyGyro.P = 20000
  78. BodyVelo.MaxForce = Vector3.new(400000,400000,400000)
  79.  
  80. local MainRay = workspace:Raycast((Character.HumanoidRootPart.CFrame).p, Vector3.new(0,-10,0),Param)
  81. if MainRay then
  82. CraterEffect.new(
  83. 'Path', -- This is the type of effect you want
  84. Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
  85. {
  86. ['BlockSize'] = {2,4};
  87. ['AnimationSpeed'] = .2;
  88. ['PartCount'] = 15;
  89. ['Angle'] = 65;
  90. ["HoldTime"] = 5;
  91. ['stepSize'] = 16;
  92. ['Width'] = {3,7};
  93. ["Range"] = 10
  94. }
  95. )
  96. else
  97. print("Nothing Here")
  98. end
  99.  
  100. local X,Y,Z = Camera.CFrame:ToEulerAnglesXYZ()
  101. BodyGyro.CFrame = CFrame.Angles(X,Y,Z)
  102. BodyVelo.Velocity = Camera.CFrame.LookVector * Speed
  103. task.spawn(function()
  104. if Speed <= 65 then
  105. Speed = 65
  106. else
  107. Speed -= .5
  108. print(Speed)
  109. end
  110. end)
  111.  
  112. else
  113. BodyVelo.MaxForce = Vector3.new()
  114. BodyGyro.MaxTorque = Vector3.new()
  115. BodyGyro.P = 0
  116. BodyGyro.D = 0
  117. Speed = 140
  118. end
  119. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement