Advertisement
iiJosephCats205

"Don't Get Too Close"

Dec 24th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. --By iiJoeCats (could be the last script for 2019)
  2. local mouse = game.Players.LocalPlayer:GetMouse()
  3. local character = game.Players.LocalPlayer.Character
  4. local ammo = 1
  5. local canDamage = false
  6. local range = 10
  7. function press(key)
  8.     if key == "e" and ammo > 0 then
  9.         ammo = 0
  10.         canDamage = not canDamage
  11.         wait(0.2)
  12.         ammo = 1
  13.     end
  14. end
  15. mouse.KeyDown:Connect(press)
  16. while game:GetService("RunService").RenderStepped:wait() do
  17.     if canDamage then
  18.         for i, v in pairs(workspace:GetChildren()) do
  19.             local hum = v:FindFirstChildOfClass("Humanoid")
  20.             local tors = v:FindFirstChild("Head")
  21.             if hum and tors then
  22.                 if v.Name ~= character.Name then
  23.                     if (character.Head.Position - tors.Position).magnitude <= range then
  24.                         local val = v:FindFirstChild("hit")
  25.                         if val then
  26.                             --nothing
  27.                         else
  28.                             Instance.new("Folder",v).Name = "hit"  
  29.                             local function rapidExplosion()
  30.                                 local bv = Instance.new("BodyVelocity",tors)
  31.                                 bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  32.                                 bv.Velocity = tors.CFrame.LookVector * 100 + Vector3.new(0,30,0)
  33.                                 local lol = Instance.new("Sound",v)
  34.                                 lol.SoundId = "rbxassetid://2216794573"
  35.                                 lol.MaxDistance = 300
  36.                                 lol.Volume = 10
  37.                                 lol:Play()
  38.                                 game.Debris:AddItem(lol,7.78)
  39.                                 for i = 1,45 do
  40.                                     wait(0.08)
  41.                                     bv.Velocity = tors.CFrame.LookVector * 100 + Vector3.new(0,30,0)               
  42.                                     local ex = Instance.new("Explosion",v)
  43.                                     ex.DestroyJointRadiusPercent = 0
  44.                                     ex.BlastPressure = 0
  45.                                     ex.BlastRadius = 0
  46.                                     ex.Position = tors.Position
  47.                                 end
  48.                                 v:BreakJoints()
  49.                             end
  50.                             rapidExplosion()
  51.                             v.hit:Destroy()
  52.                         end
  53.                     end
  54.                 end
  55.             end
  56.         end
  57.     end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement