I created a tool which uses the model as the hit box, and it works however, it doesn’t hit multiple characters in one swing
Here is the script file; the script is also at the end of this post:
HitBoxAGAIN.lua (2.9 KB)
Here is where the script is located if that’s relevant:
and here is where I believe the issue is:
Normal:
Without Disconnect (doesn’t matter if I put a debounce):
local Hitbox = script.Parent
local remote = game.ReplicatedStorage.AttackEvent
local damageDone = 99
local hitlist = game.Workspace.HitList:GetChildren()
local connection = nil
local function KnockBack(pChar, eChar)
if pChar and eChar then
local pHrp = pChar:FindFirstChild("HumanoidRootPart")
local eHrp = eChar:FindFirstChild("HumanoidRootPart")
if pHrp and eHrp then
local dir = (eHrp.Position - pHrp.Position).Unit
local att = Instance.new("Attachment", eHrp)
local force = Instance.new("VectorForce", eHrp)
force.Attachment0 = att
force.Force = (dir + Vector3.new(0,1,0)).Unit * 9000
force.RelativeTo = Enum.ActuatorRelativeTo.World
eChar.Humanoid.PlatformStand = true
local rot = Instance.new("AngularVelocity", eHrp)
rot.Attachment0 = att
rot.AngularVelocity = Vector3.new(1,0,1) * 10
rot.MaxTorque = math.huge
rot.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
game.Debris:AddItem(force, .1)
game.Debris:AddItem(rot, .1)
game.Debris:AddItem(att, .1)
wait(0.5)
eChar.Humanoid.PlatformStand = false
end
end
end
local function SentToSpace(pChar, eChar) -- use if char.health <= 10
if pChar and eChar then
local pHrp = pChar:FindFirstChild("HumanoidRootPart")
local eHrp = eChar:FindFirstChild("HumanoidRootPart")
if pHrp and eHrp then
local dir = (eHrp.Position - pHrp.Position).Unit
local att = Instance.new("Attachment", eHrp)
local force = Instance.new("VectorForce", eHrp)
force.Attachment0 = att
force.Force = (dir + Vector3.new(0,1,0)).Unit * 10000
force.RelativeTo = Enum.ActuatorRelativeTo.World
eChar.Humanoid.PlatformStand = true
end
end
end
remote.OnServerEvent:Connect(function(player)
connection = Hitbox.Touched:Connect(function(other_object)
if not hitlist then return end
print("passed1")
local humanoid = other_object.Parent:FindFirstChild("Humanoid")
if not humanoid then
connection:Disconnect()
print("nothum")
end
if humanoid then
if humanoid.Health <= 0 then
print("huamnoiddead")
connection:Disconnect()
else
connection:Disconnect()
humanoid:TakeDamage(100)
local sounds = game.ReplicatedStorage.Sound
local HitPunchSFX = sounds.hit_punch_l:Clone()
local WoodBreakSFX = sounds.wood_solid_impact_bullet2:Clone()
local VFX = game.ReplicatedStorage.HitVFX.Attachment.ParticleEmitter:Clone()
VFX.Parent = other_object.Parent.Torso
VFX:Emit(1)
game.Debris:AddItem(VFX, 1.2)
HitPunchSFX.Parent = other_object.Parent.Torso
WoodBreakSFX.Parent = other_object.Parent.Torso
HitPunchSFX.Volume = 1
WoodBreakSFX.Volume = 0.2
KnockBack(player.Character, other_object.Parent)
HitPunchSFX:Play()
WoodBreakSFX:Play()
connection:Disconnect()
end
end
end)
task.wait(1.3)
connection:Disconnect()
end)