Advertisement
SxScripting

Snap Viribus [Server Script]

Jan 7th, 2021
899
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. local RS = game:GetService("ReplicatedStorage")
  2.  
  3. local Delays = 2
  4. local YSize = 11
  5.  
  6. local Waits = {}
  7.  
  8. RS.Event.OnServerEvent:Connect(function(plr)
  9. if not plr or not plr.Character then return end
  10. local Character = plr.Character
  11. if not Character.PrimaryPart then return end
  12. if not Character:FindFirstChild("Humanoid") then return end
  13. if table.find(Waits, plr) then return end
  14. table.insert(Waits, plr)
  15.  
  16. local Animation = Instance.new("Animation")
  17. Animation.AnimationId = "rbxassetid://6069690501"
  18. Character.Humanoid:LoadAnimation(Animation):Play()
  19.  
  20. wait(1/6) --.1667
  21. for i = 1,8 do
  22. local RaycastR
  23. local function Check(Param, Exclude)
  24. if i % 2 == 0 then
  25. RaycastR = workspace:Raycast((Character.PrimaryPart.CFrame * CFrame.new(3,0,-i*3.6)).Position, Vector3.new(0,-180,0) * 100, Param)
  26. else
  27. RaycastR = workspace:Raycast((Character.PrimaryPart.CFrame * CFrame.new(-3,0,-i*3.6)).Position, Vector3.new(0,-180,0) * 100, Param)
  28. end
  29.  
  30. local Insta = RaycastR.Instance
  31. if Insta.Parent and Insta.Parent:FindFirstChild("Humanoid") then
  32. table.insert(Exclude, Insta.Parent)
  33. Param.FilterDescendantsInstances = Exclude
  34. Check(Param, Exclude)
  35. end
  36. end
  37.  
  38. local RayCastPa = RaycastParams.new()
  39. RayCastPa.FilterType = Enum.RaycastFilterType.Blacklist
  40. Check(RayCastPa, {})
  41.  
  42. if RaycastR then
  43. local Hits = {}
  44. local Pillar = RS.Pillar:Clone()
  45. Pillar.Material = RaycastR.Material
  46. Pillar.Size = Pillar.Size + Vector3.new(0,0,1)
  47. Pillar.Parent = workspace
  48. Pillar.Position = RaycastR.Position + Vector3.new(math.random(1,5),0,math.random(1,5))
  49. game.TweenService:Create(Pillar, TweenInfo.new(.2), {Position = Pillar.Position + Vector3.new(0,YSize/2,0), Size = Pillar.Size + Vector3.new(0,YSize,0)}):Play()
  50.  
  51. delay(.2, function()
  52. for i,v in pairs(Pillar:GetTouchingParts()) do
  53. if not v or not v.Parent or not v.Parent:FindFirstChild("Humanoid") then return end
  54. if v:IsDescendantOf(Character) then return end
  55. if table.find(Hits, v.Parent.Humanoid) then return end
  56. table.insert(Hits, v.Parent.Humanoid)
  57. v.Parent.Humanoid:TakeDamage(10)
  58. end
  59. end)
  60.  
  61. delay(.8, function()
  62. game.TweenService:Create(Pillar, TweenInfo.new(.2), {Position = Pillar.Position + Vector3.new(0,-YSize/2,0), Size = Pillar.Size * Vector3.new(1,0,1)}):Play()
  63. end)
  64.  
  65. game.Debris:AddItem(Pillar, 1)
  66. wait(.1)
  67. Pillar.Touched:Connect(function(Hit)
  68. if not Hit or not Hit.Parent or not Hit.Parent:FindFirstChild("Humanoid") then return end
  69. if Hit:IsDescendantOf(Character) then return end
  70. if table.find(Hits, Hit.Parent.Humanoid) then return end
  71. table.insert(Hits, Hit.Parent.Humanoid)
  72. Hit.Parent.Humanoid:TakeDamage(10)
  73. end)
  74. end
  75. end
  76. wait(2)
  77. Animation:Destroy()
  78. table.remove(Waits, table.find(Waits, plr))
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement