Advertisement
SxScripting

ConqHaki[Server Script]

Sep 12th, 2021
1,348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. +local RunService = game:GetService("RunService")
  2. local RS = game:GetService("ReplicatedStorage")
  3. local CS = game:GetService("CollectionService")
  4. local TS = game:GetService("TweenService")
  5.  
  6. local Debounce = {}
  7. local Debounce2, Plr = nil, nil
  8. local AddPlayers,TrashTable = {}, {}
  9.  
  10. local Duration, Cooldown, EndTime= 1.7 , 2 , 1
  11. local Spin = 0
  12.  
  13. local function getSpeed(Char,Walk,Jump,Anc)
  14. Char.Humanoid.WalkSpeed = Walk or 16
  15. Char.Humanoid.JumpPower = Jump or 50
  16. Char.HumanoidRootPart.Anchored = Anc or false
  17. end
  18.  
  19. RS.Events.getConHaki.OnServerEvent:Connect(function(Player)
  20. if CS:HasTag(Player.Character,"DoneEffect") then return end
  21. if Debounce[Player] then return end
  22. if Debounce2 then return end; Plr = Player
  23.  
  24. Debounce[Player] = game.ReplicatedStorage.Effects.ConqHaki:Clone()
  25. Debounce[Player].Parent = workspace; Debounce[Player].Position = Player.Character.Head.Position
  26. TS:Create(Debounce[Player], TweenInfo.new(Duration), {Size = Vector3.new(150,150,150);}):Play()
  27. end)
  28.  
  29. RunService.Heartbeat:Connect(function()
  30. if not Debounce[Plr] then return end
  31. Spin += 5
  32.  
  33. local NewParams = OverlapParams.new()
  34. NewParams.FilterDescendantsInstances = {Plr.Character}
  35. NewParams.FilterType = Enum.RaycastFilterType.Blacklist
  36. NewParams.MaxParts = 0
  37. Debounce[Plr].Orientation = Vector3.new(Spin,0,-Spin)
  38.  
  39. for Index,Value in pairs(workspace:GetPartsInPart(Debounce[Plr],NewParams)) do
  40. if Value.Parent:FindFirstChild("Humanoid") and not table.find(AddPlayers,Value.Parent) then
  41. AddPlayers[#AddPlayers + 1] = Value.Parent
  42. end
  43. end
  44.  
  45. for Index2,Value2 in pairs(AddPlayers) do
  46. if CS:HasTag(Value2,"DoneEffect") then continue end
  47. if Debounce2 then return end
  48. if Value2 == Plr.Character or not Value2:FindFirstChild("HumanoidRootPart") then continue end
  49. local Animation = Instance.new("Animation"); Animation.AnimationId = "rbxassetid://7356099138";
  50. local StartAnim = Value2.Humanoid:LoadAnimation(Animation)
  51. local HeadEffect = game.ReplicatedStorage.Effects.HeadEffect:Clone()
  52.  
  53. HeadEffect.DescendantRemoving:Connect(function(Descendants)
  54. TrashTable[#TrashTable + 1] = Descendants
  55. end)
  56.  
  57. table.insert(AddPlayers, StartAnim)
  58. HeadEffect.HakiAttach.Parent = Value2.Head
  59. CS:AddTag(Value2,"DoneEffect")
  60. getSpeed(Value2,0,0,true)
  61. StartAnim:Play()
  62.  
  63. if game.Players:GetPlayerFromCharacter(Value2) then
  64. RS.Events.getConHaki:FireClient(game.Players:GetPlayerFromCharacter(Value2),Duration)
  65. else
  66. continue
  67. end
  68. end
  69.  
  70. task.delay(Duration,function()
  71. if Debounce2 then return end
  72. Debounce2 = true
  73.  
  74. local Tween2 = TS:Create(Debounce[Plr], TweenInfo.new(EndTime), {Transparency = 1})
  75. Tween2:Play()
  76.  
  77. for Index,Value in pairs(TrashTable) do
  78. Value:Destroy()
  79. TrashTable[Index] = nil
  80. end
  81.  
  82. for Index,Value in pairs(AddPlayers) do
  83. if Value:FindFirstChild("Humanoid") then
  84. if CS:HasTag(Value,"DoneEffect") then CS:RemoveTag(Value,"DoneEffect") end
  85. getSpeed(Value)
  86. else
  87. Value:Stop()
  88. end
  89. AddPlayers[Index] = nil
  90. end
  91.  
  92. wait(Cooldown)
  93. Tween2:Destroy()
  94. Debounce[Plr]:Destroy(); Debounce[Plr] = nil
  95. Debounce2 = false
  96. end)
  97. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement