Advertisement
JoshXploits

Hitbox HD

Jan 22nd, 2022
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.94 KB | None | 0 0
  1. local Damagee = {}
  2. local effects = {}
  3. local SS = game:GetService("ServerStorage")
  4. local config = SS.Config
  5.  
  6.  
  7. local effectsRemote = game:GetService("ReplicatedStorage")["Main"]:WaitForChild("effects"):WaitForChild("EffectsEvent")
  8. Damagee.NormalHitbox = (function(plr,chr,dmg,hitboxtime,emittime,Force,StunTime,HitboxExtend,IsStand)
  9.     local debounce = false
  10.     local hum =  chr:WaitForChild("Humanoid")
  11.     local Humrp = chr:WaitForChild("HumanoidRootPart")
  12.     local hitbox =  game.ServerStorage.HitBox:Clone()
  13.     local UV = chr.UserValues
  14.     local IsUsingMove = UV.IsUsingMove
  15.     local GettingAttacked = UV.GettingAttacked
  16.     local howlongtothedeleteting = .3
  17.     hitbox.Parent = workspace.Effects
  18.     hitbox.Size = hitbox.Size + Vector3.new(HitboxExtend,0,0)
  19.     if IsStand then
  20.         hitbox.CFrame =  chr.Stand.HumanoidRootPart.CFrame + chr.Stand.HumanoidRootPart.CFrame.LookVector*2
  21.     elseif not IsStand then
  22.         hitbox.CFrame =  chr.HumanoidRootPart.CFrame + chr.HumanoidRootPart.CFrame.LookVector*2
  23.     end
  24.     hitbox.Orientation = chr.HumanoidRootPart.Orientation + Vector3.new(0,-90,0)
  25.     local weld =  Instance.new("WeldConstraint")
  26.     weld.Part0 = chr.HumanoidRootPart
  27.     weld.Part1 =  hitbox
  28.     weld.Parent =  weld.Part0
  29.     game.Debris:AddItem(weld,hitboxtime + 0.2)
  30.     game.Debris:AddItem(hitbox,hitboxtime + 0.2)
  31.     hitbox.Touched:Connect(function(hit)
  32.         print("OMGYASS")
  33.         if hit.Parent ~= chr and hit.Parent:IsA("Model")and hit.Parent:FindFirstChild("Humanoid") and not UV:FindFirstChild("StunDetect")  and hit.Parent ~= chr:FindFirstChild("Stand")  then
  34.             print("OMGYASS EZ JAJAJA MOREEEEEEEEE")
  35.             if debounce == false then
  36.                 debounce = true
  37.                 hitbox:Destroy()
  38.                
  39.                 local eChar =  hit.Parent
  40.                 local eHumrp = eChar:FindFirstChild("HumanoidRootPart")
  41.                 local eHum =  eChar:FindFirstChild("Humanoid")
  42.  
  43.  
  44.                 local eUV = eChar.UserValues
  45.                 local eIsUsingMove = eUV.IsUsingMove
  46.                 local eGettingAttacked = eUV.GettingAttacked
  47.                 local Block = eUV.IsBlocking
  48.                
  49.                 eHumrp.CFrame = CFrame.new(eHumrp.Position,Humrp.Position)
  50.                 if Block.Value and not UV:FindFirstChild("StunDetect") then
  51.                     eHum:TakeDamage(dmg/100)
  52.                     task.spawn(function()
  53.                         effectsRemote:FireAllClients(eChar.Torso,"Block",1)
  54.                     end)
  55.                     local Sound = script.Sound.ForBasic.Block:Clone()
  56.                    
  57.                     Sound.Parent = eHumrp
  58.                     Sound:Play()
  59.                     game.Debris:AddItem(Sound,Sound.TimeLength + 0.4)
  60.                    
  61.                 elseif not Block.Value and not UV:FindFirstChild("StunDetect") then
  62.                     game.ReplicatedStorage.ComboGUIReciever:FireAllClients(dmg)
  63.                     spawn(function()
  64.                         local StunValue = Instance.new("Model", eUV)
  65.                         StunValue.Name = "StunDetect"
  66.                         game.Debris:AddItem(StunValue,1)
  67.                         --eGettingAttacked.Value = true
  68.                         --print("getting attacked!")
  69.                         --wait(1)
  70.                         --eGettingAttacked.Value = false
  71.                         --print("not getting attacked anymore")
  72.                     end)
  73.                     game.ReplicatedStorage.Main.Client.Combo:FireClient(plr)
  74.                     local vel = Instance.new("BodyVelocity")
  75.                     vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  76.                     vel.Parent = eHumrp
  77.                     vel.Velocity = Humrp.CFrame.LookVector * Force
  78.                     vel.Name  =  "SmallMoveVel"
  79.                     game.Debris:AddItem(vel,howlongtothedeleteting)
  80.  
  81.                     local vel = Instance.new("BodyVelocity")
  82.                     vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  83.                     vel.Parent = Humrp
  84.                     vel.Velocity = Humrp. CFrame.LookVector * Force / 2
  85.                     vel.Name  =  "SmallMoveVel"
  86.                     game.Debris:AddItem(vel,howlongtothedeleteting)
  87.                      
  88.                     eHum:TakeDamage(dmg)
  89.                     task.spawn(function()
  90.                         effectsRemote:FireAllClients(eChar.Torso,"NormalHitEffect",emittime)
  91.                         local hitanim = eHum:LoadAnimation(script.Animations.Basic.hit)
  92.                         hitanim:Play()
  93.                     end)
  94.                     local Sound = script.Sound.ForBasic.Rad1:Clone()
  95.                     Sound.Parent = eHumrp
  96.                     Sound:Play()
  97.                     game.Debris:AddItem(Sound,Sound.TimeLength + 0.4)
  98.                 end
  99.             end
  100.         end
  101.  
  102.     end)
  103.  
  104.  
  105.     debounce = false
  106.  
  107.  
  108. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement