Raycasting Guns

Ok I found it but now the zombies come after you but then start charging each other and do no damage

Try this in your zombie script

local zombie = script.Parent
local hum = zombie:WaitForChild("Humanoid")

hum.Died:Connect(function()
    local tag = zombie:FindFirstChild("creator")

	if tag then
    	local plr = tag.Value
    	local leaderstats = plr:FindFirstChild("leaderstats")
	
    	if leaderstats then
    		leaderstats.Cash.Value = leaderstats.Cash.Value + 15
    	end
	end
end)

and now there is not more Zombie, Humanoid anywhere because I looked in every script and used ctrl f

I’m not sure how your zombie AI works, but that’s another story. For now, just try shooting the zombies and see if they give you money.

Also Forgot to mention they take no damage

That’s because the scripts I’ve given you assume that the Zombie’s Humanoid Name is “Humanoid”. Change the humanoid name back to “Humanoid” and shoot them.

Also, can you check your output log for any errors?

Its been named humanoid even when I tested it and they took no damage

Are there any errors fired in the output?

Yes and I just found another script and changed now time to see if it works

Ok so there is two problem first one being they go after each other and kill each other the second problem is that they are taking no damage

I also just changed another one of my weapons that had been working and it was killing them but giving no cash

Can you send a screenshot of your output log?

Edit: Go to View → Output

Then run your game and take a screenshot of what you see in the output.

how do you take a screenshot on windows 10

Go to search, search up snipping tool, and make a new snip.

Thats even after I run it and the zombies and everything going after each other and the gun doing no damage

Can you send a screenshot of the portion of your gun script that checks for hits and deals the damage?

image

Where are you calling OnHit?

Edit: characterscharacters

After the Raycasting
(characters)