← resources/ module / hitbox-cast
FREE
Lag-compensated hitbox
Server-validated raycast + spatial-query hitboxes with ping compensation. Fair for high-ping players, unfair for exploiters.
Hitbox.luaupreview — first 10 of 28 lines
--!strict-- Hitbox — server-validated, ping-compensated melee hitboxes.local Hitbox = {}Hitbox.__index = Hitboxfunction Hitbox.new(size: Vector3) return setmetatable({ size = size, hit = {} }, Hitbox)endfunction Hitbox:cast(cframe: CFrame, ignore: { Instance }) local params = OverlapParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = ignore local found = {} for _, part in workspace:GetPartBoundsInBox(cframe, self.size, params) do local model = part:FindFirstAncestorOfClass("Model") local hum = model and model:FindFirstChildOfClass("Humanoid") if hum and not self.hit[hum] then self.hit[hum] = true table.insert(found, hum) end end return foundendreturn Hitbox