Advertisement
SxScripting

IgnisServerScript

Apr 26th, 2021
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. local RunService = game:GetService("RunService")
  2. local RST = game.ReplicatedStorage.Events.Ragdoll
  3. local Debounce,v1,v2 = {},{},{}
  4. local Deb2,v3 = {},{}
  5.  
  6. RST.OnServerEvent:Connect(function(Player)
  7. if Player:WaitForChild("DataFolder").Mana.Value == 0 and not Deb2[Player] then return end
  8. if Debounce[Player] then return end
  9. Debounce[Player] = true
  10.  
  11. local Mana = Player:WaitForChild("DataFolder").Mana
  12. local Character = Player.Character
  13. local IgnisFire = game.ReplicatedStorage.FireForwad:Clone()
  14. IgnisFire.Position = Character["Right Arm"].Position + Vector3.new(0,-.5,0)
  15. local IgnisSnap = Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent.IgnisAnimation)
  16. IgnisSnap:Play()
  17. IgnisFire.Parent = workspace
  18.  
  19. local function BurningEffect(NBR,HMN,HRP)
  20. local Burn = game.ReplicatedStorage.Burning:Clone()
  21. Burn.Position = HRP.Position
  22. Burn.Parent = workspace
  23. local WeldC = Instance.new("WeldConstraint",HRP)
  24. WeldC.Part0 = HRP
  25. WeldC.Part1 = Burn
  26.  
  27. v3[Player] = WeldC
  28. for i = 1,NBR do
  29. wait(.25)
  30. HMN:TakeDamage(1)
  31. if i == NBR then v3[Player]:Destroy() else continue end
  32. end
  33. end
  34.  
  35. local WC = Instance.new("WeldConstraint",Character["Right Arm"])
  36. WC.Part0 = Character["Right Arm"]
  37. WC.Part1 = IgnisFire
  38.  
  39. v1[Player] = WC
  40. Deb2[Player] = true
  41.  
  42. Mana.Changed:Connect(function()
  43. if Mana.Value == 0 and Deb2[Player] then
  44. Deb2[Player] = false
  45. end
  46. end)
  47.  
  48. local function CheckRay()
  49. if Deb2[Player] then
  50. local RayList = RaycastParams.new()
  51. RayList.FilterType = Enum.RaycastFilterType.Blacklist
  52. RayList.FilterDescendantsInstances = {Player.Character}
  53.  
  54. local MainRay = workspace:Raycast((Character.HumanoidRootPart.CFrame).p,Character.HumanoidRootPart.CFrame.LookVector * 15.5, RayList)
  55.  
  56. if MainRay and Deb2[Player] and Mana.Value ~= 0 then
  57. if MainRay.Instance.Parent:FindFirstChild("Humanoid") then
  58. return true, MainRay.Instance.Parent
  59. end
  60. end
  61. end
  62. end
  63.  
  64. while Deb2[Player] do
  65. wait()
  66. local U1, U2 = CheckRay()
  67. if U1 then
  68. local BV = Instance.new("BodyVelocity", U2:FindFirstChild("HumanoidRootPart"))
  69. BV.MaxForce = Vector3.new(1e8, 10000, 1e8)
  70. BV.Velocity = Character.HumanoidRootPart.CFrame.LookVector * 15
  71. BurningEffect(5,U2:FindFirstChild("Humanoid"),U2:FindFirstChild("HumanoidRootPart"))
  72. v2[Player] = BV
  73. wait()
  74. v2[Player]:Destroy()
  75. break
  76. end
  77. end
  78.  
  79.  
  80. repeat wait() until not Deb2[Player]
  81. Deb2[Player] = nil
  82. IgnisSnap:Stop()
  83. v1[Player]:Destroy() v1[Player] = nil
  84. if v2[Player] ~= nil then v2[Player]:Destroy() end
  85. if v3[Player] ~= nil then v3[Player]:Destroy() end
  86.  
  87. Debounce[Player] = nil
  88. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement