Skip to main content

Table of Contents


ClientCast is a simple and elegant solution to handling weapon hitboxes. This module is written with efficiency, simplicity and customizability in mind. This module is meant to be bareboned. ClientCast relies solely on raycasts to provide with hitbox data, and as such is not only extremely efficient, but also provides detailed information on where and when it hit an object. If you would like to get extra data or add your own functions, the best solution would be to simply wrap the object and add your own methods onto it.

The main forte of ClientCast lies in the fact that you can easily communicate with the client, letting the client handle all the calculations and then have the server be notified whenever the client intersects something. This allows the server to have to calculate way less and also take into account for a player's ping or delay, providing all players a lag-free experience.

Example Usage

Making a part kill players

Simply parent the ClientCast folder to ServerStorage and run this script on the server:

local ClientCast = require(game.ServerStorage.ClientCast)

local KillPart ='Part')
KillPart.Anchored = true
KillPart.CanCollide = false
KillPart.CFrame =, 1, 0)
KillPart.Parent = workspace

function GenerateAttachment(Position)
local Attachment ='Attachment')
Attachment.Name = 'DmgPoint'
Attachment.Position = Position
Attachment.Parent = KillPart

for X = -2, 2 do
GenerateAttachment(, Y, Z))

local ClientCaster =,
local Debounce = {}
ClientCaster.HumanoidCollided:Connect(function(RaycastResult, HitHumanoid)
if Debounce[HitHumanoid] then
Debounce[HitHumanoid] = true

Debounce[HitHumanoid] = false

Note: This will not work until the part starts moving around.



To start using this module, simply put attachments called DmgPoint (name is customizable in the Settings table at the top of the ClientCast ModuleScript) inside the object, and then create a ClientCaster object, with it's Object set to your hitbox. Example:

-- Call module
local ClientCast = require(PATH.ClientCast)
-- Create ClientCaster object
local Caster =,

-- Connect callback to 'Collided' event
-- Set owner of ClientCaster, who will be the one to calculate collisions.
-- You can skip this if you want the server to be the owner.
-- Start detecting collisions