How to make a hitbox?

I am new to scripting and as of right now am attempting to figure out how to make a hitbox for a forsaken killer concept.

Code:

local remote = script.Parent
remote.OnServerEvent:Connect(function(player, skill)
local char = player.Character or player.CharacterAdded:wait()
local rootPart = char:WaitForChild(‘HumanoidRootPart’)
local hitbox = script.Parent.Parent.Parent.Torso:FindFirstChild(“Hitbox”)
local humanoid = char:FindFirstChild(“Humanoid”)
if skill == “Punch” then
local track = Instance.new(“Animation”)
track.AnimationId = “rbxassetid://132305779707156”
local Anim = char.Humanoid:LoadAnimation(track)
Anim:Play()
end
end)

1 Like

Depends on what works best, you could do a distance check instead of a hitbox, or a raycast hitbox, or a spacial query hitbox ( seeing the parts inside of a box/part ), it really depends on how you want your hitboxes to be

1 Like

Which of these would work best without a reliance on a tool? I guess it could be spacial query hitbox but i want your decision. Btw to explain, the hitbox will appear in front of the player on a left mouse click.

1 Like

Depends, are you making pvp, pve, or something different?