#Hitbox Help

1 messages · Page 1 of 1 (latest)

zinc knot
#
local HB = Instance.new("Part")
HB.Size = Vector3.new(3,6,5)
HB.CanCollide = false
HB.Color = Color3.fromRGB(255, 0, 0)
HB.Transparency = 0.6
HB.Anchored = true
HB.CFrame = Char:FindFirstChild("Head").CFrame * CFrame.new(0,-1,-4)
                
AttackingLoad:Play()
                
HB.Parent = workspace
                
Debris:AddItem(HB, 1)
                
HB.Touched:Connect(function(Hit)
                    
local Target = PS:GetPlayerFromCharacter(Hit.Parent)

if not Target or Target == Player then warn("we hit local player") return end
                    
Attack(Target)

end)

the attack function just prints out the hit player for now

#

i get that im still trash at scripting but i dont see why it shouldnt work

#

btw this is a local script

nova fable
#

idk explanation but anchored false fixes it somone explain

nova fable
#

but another alternative is through GetPartBoundsInBox

#

it should work with that even if anchored

shell sapphire
nova fable
#

ok but why does it fire when player is near