Advertisement
IHATEMICROWAVEOVEN

melee code by squeeze THE GOAT

Jul 27th, 2023 (edited)
1,247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.70 KB | None | 0 0
  1. -- This code was written by Squeezemeister.
  2.  
  3.  
  4. local function FindHittablePlayers()
  5.     for i, Player in pairs(game.Players:GetChildren()) do
  6.         if Player.Character ~= nil and Player.Character:FindFirstChild("Torso") and (Player.Character.Torso.Position - Model.Torso.Position).Magnitude <= 15 then
  7.             return true
  8.         end
  9.     end
  10. end
  11.  
  12. coroutine.wrap(function()
  13.     while Model:FindFirstChild("SLP") do
  14.         task.wait(5)
  15.  
  16.         local found = FindHittablePlayers()  -- don't make a table OR ELSE! (that's why its false)
  17.         if found then
  18.             local warning = game.ServerStorage.Items["ANGRY!"]:Clone()
  19.             warning.CanCollide, warning.Anchored, warning.Massless, warning.CFrame =
  20.                 false, false, true, Model.Torso.CFrame*CFrame.new(-0.5, -0.5, 1)*CFrame.Angles(0, 0, math.rad(15))
  21.             local weld = Instance.new("Weld")
  22.             weld.Part0, weld.Part1, weld.C0 = warning, Model.Torso, CFrame.new(-0.5, -0.5, 1)
  23.             weld.Parent = warning
  24.             warning.Parent = workspace
  25.  
  26.             task.wait(0.5)  -- warning time
  27.             warning:Destroy()
  28.  
  29.             local inner = Instance.new("Part")
  30.             inner.CanCollide, inner.Massless, inner.CFrame = false, true, Model.Torso.CFrame
  31.             inner.Material = "Neon"
  32.             inner.BrickColor = BrickColor.new("Really black")
  33.             inner.Size = Vector3.new(5, 5, 5)
  34.             inner.Transparency = 0.5
  35.  
  36.             local outer = Instance.new("Part")
  37.             outer.CanCollide, outer.Massless, outer.CFrame = false, true, Model.Torso.CFrame
  38.             outer.Material = "Neon"
  39.             outer.BrickColor = BrickColor.new("Dark indigo")
  40.             outer.Size = Vector3.new(9, 9, 9)
  41.             outer.Transparency = 0.8
  42.  
  43.             local light = Instance.new("PointLight")
  44.             light.Enabled, light.Shadows = true, false
  45.             light.Brightness, light.Range = 5, 10
  46.             light.Color = Color3.new(0, 0, 0.498039)
  47.  
  48.             weld = Instance.new("Weld")
  49.             weld.Part0, weld.Part1 = inner, Model.Torso
  50.             weld.Parent = inner
  51.             weld = Instance.new("Weld")
  52.             weld.Part0, weld.Part1 = outer, Model.Torso
  53.             weld.Parent = outer
  54.  
  55.             game:GetService("Debris"):AddItem(inner, 2)
  56.             game:GetService("Debris"):AddItem(outer, 2)
  57.             light.Parent = outer
  58.             inner.Parent, outer.Parent = workspace, workspace
  59.  
  60.             for i, Player in pairs(game.Players:GetChildren()) do
  61.                 if Player.Character ~= nil and Player.Character:FindFirstChild("Torso") and (Player.Character.Torso.Position - Model.Torso.Position).Magnitude <= 15 then
  62.                     DamageMod:RegisterDamage(Model, Player, CLOSEDAMAGE)
  63.                     -- Below is the code for pushing.
  64.                         --[[
  65.                         local bv = Instance.new("BodyVelocity")
  66.                         bv.MaxForce, bv.Velocity = Vector3.new(math.huge, math.huge, math.huge), Model.Torso.CFrame.LookVector * 50
  67.                         game:GetService("Debris"):AddItem(bv, 0.5)
  68.                         bv.Parent = Player.Character.Torso
  69.                         ]]
  70.                 end
  71.             end
  72.         end
  73.     end
  74. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement