Raycasting Guns

Can you send a portion of that too?

I also just moved it done and still nothing

After

if hitHumanoid then

just call
OnHit(plr(who shot the gun), hitObject)

You have to call a function to use it.

I moved it and still nothing they were still invincible

My OnHit function assumes the zombie humanoid is named “Humanoid”, but in your script, you refer to the humanoid as “Zombie” still.

local hitHumanoid = hitObject.Parent:FindFirstChild("Zombie") --Change this to Humanoid

Whoops… Forgot all about that part

Also where are you calling OnHit?

Ok so I just tested and it was counting the hit markers but it was not killing them

Don’t put the function in the code. The function is supposed to be BEFORE the code.
Put it at the beginning of the script, and inside there, call OnHit(plr, hit).

Still nothing happens when I do that

Send me a screenshot of your code again.

Where are you calling OnHit though??

Also on another note I just added this script to a gun I love that will be pretty costy in the game and it worked fine and gave me cash

That’s the function, you have to go to your hit detection and actually use it.