Advertisement
SxScripting

God Speed Server Script

Aug 29th, 2022
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. local RS = game:GetService("ReplicatedStorage")
  2. local Tween = game:GetService("TweenService")
  3. local Debris = game:GetService("Debris")
  4.  
  5. local GodSpeedModeTool = script.Parent.Parent:WaitForChild("God Speed[Mode]")
  6. local GSMove1 = script.Parent.Parent:WaitForChild("Move1")
  7.  
  8. local Player = GodSpeedModeTool.Parent.Parent
  9. local Character = Player.Character or Player.CharacterAdded:Wait()
  10. local Humanoid = Character:WaitForChild("Humanoid")
  11.  
  12. local Debounce = {}
  13. local EffectOn = {}
  14.  
  15. local Moves = {
  16. Move1 = {};
  17. }
  18.  
  19. local MouseRange = 250 -- the range for the mouse
  20. local Cooldown = 2 -- Mode Cooldown
  21. local Duration = 5 -- Length of God Speed
  22. local Move1_Cooldown = .5 -- First Move Cooldown
  23.  
  24. -- MODE --
  25.  
  26. local function Movement(Humanoid, WalkSpeed, JumpPower)
  27. Humanoid.WalkSpeed = WalkSpeed;
  28. Humanoid.JumpPower = JumpPower;
  29. end
  30.  
  31. local function ApplyParticle(Value, Duration)
  32. for i,v in pairs(Value:GetChildren()) do
  33. local Effect = RS.Effects.Aura.ExplosionBrightspot:Clone()
  34. Effect.Parent = v
  35.  
  36. game.Debris:AddItem(Effect,Duration)
  37. end
  38. end
  39.  
  40. local function KnockUp(Target, Duration,STR1,STR2)
  41. local EffectVelocity = Instance.new("BodyVelocity", Target:FindFirstChild("HumanoidRootPart"))
  42. EffectVelocity.MaxForce = Vector3.new(1, 1, 1) * 1000000;
  43. EffectVelocity.Velocity = Vector3.new(1, 1, 1) * Character.HumanoidRootPart.CFrame.UpVector * math.random(STR1, STR2)
  44.  
  45. game.Debris:AddItem(EffectVelocity, Duration)
  46.  
  47. end
  48.  
  49. local function MousePos()
  50. local MousePosition = RS.Events.RemoteFunction:InvokeClient(Player) -- Getting the Mouse Position
  51. if (Character.HumanoidRootPart.Position - MousePosition).Magnitude <= MouseRange then -- Make Mouse Range
  52. return MousePosition -- Return if it's in range
  53. end
  54. return Character.HumanoidRootPart.Position, print("Out Of Range") -- if not then they do the move in place
  55. end
  56.  
  57. GodSpeedModeTool.Activated:Connect(function()
  58. if Debounce[Player] then return end
  59. if EffectOn[Player] then return end
  60. EffectOn[Player] = true
  61.  
  62. for Index,Value in pairs(Character:GetChildren()) do -- Adding the particles
  63. local AuraEffect = RS.Effects.Aura:Clone()
  64. if not Value:IsA("BasePart") then continue end
  65. for NumIndex, NumValue in pairs(AuraEffect:GetChildren()) do
  66. NumValue.Parent = Value
  67. end
  68. end
  69.  
  70. Movement(Humanoid,50,55) -- Start Speed
  71. task.wait(Duration)
  72. Movement(Humanoid,16,50) -- Reset Speed
  73.  
  74. for i,v in pairs(Character:GetDescendants()) do -- Removing the Particles
  75. if not v:IsA("ParticleEmitter") then continue end
  76. v:Destroy()
  77. end
  78.  
  79. EffectOn[Player] = not true -- Make Sure [Moves] can't be used
  80. Debounce[Player] = true -- NOT FIRING ON COOLDOWN
  81.  
  82. task.delay(Cooldown + .5, function() -- Making Debounce Basically
  83. Debounce[Player] = nil
  84. end)
  85.  
  86. end)
  87.  
  88. -- MOVE --
  89.  
  90. GSMove1.Activated:Connect(function()
  91. if not EffectOn[Player] then return end
  92. if Moves.Move1[Player] then return end
  93. Moves.Move1[Player] = true
  94.  
  95. local Properties = {
  96. Position = MousePos() + Vector3.new(0,10,0);
  97. Orientation = Vector3.new(0,math.rad(90),0)
  98. }
  99.  
  100. local Tweenv1 = Tween:Create(Character.HumanoidRootPart,
  101. TweenInfo.new(.3,Enum.EasingStyle.Quad),
  102. Properties
  103. );Tweenv1:Play()
  104.  
  105. Tweenv1.Completed:Connect(function()
  106. local Radius = 15
  107. RS.Events.Crater:FireAllClients(Radius, (Character.HumanoidRootPart.CFrame).Position, 2)
  108.  
  109. local Paramas = OverlapParams.new()
  110. Paramas.FilterDescendantsInstances = {Character, game.Workspace.Baseplate}
  111. Paramas.FilterType = Enum.RaycastFilterType.Blacklist
  112. Paramas.MaxParts = math.huge
  113.  
  114.  
  115. for Index,Value in pairs(workspace:GetPartBoundsInRadius((Character.HumanoidRootPart.CFrame).Position,Radius + 1,Paramas)) do
  116. if Value.Parent:FindFirstChildOfClass("Humanoid") and not table.find(Moves.Move1, Value.Parent) then
  117. Moves.Move1[#Moves.Move1 + 1] = Value.Parent
  118. Value.Parent.Humanoid:TakeDamage(10)
  119.  
  120. KnockUp(Value.Parent,.3,50,70)
  121. ApplyParticle(Value.Parent,2)
  122. Movement(Value.Parent:FindFirstChild("Humanoid"),2,10)
  123.  
  124. task.delay(2,function()
  125. Movement(Value.Parent:FindFirstChild("Humanoid"),16,50)
  126. end)
  127. end
  128. end
  129. end)
  130.  
  131. wait(Move1_Cooldown)
  132.  
  133. for i,v in pairs(Moves.Move1) do
  134. Moves.Move1[i] = nil
  135. end
  136. Moves.Move1[Player] = nil
  137. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement