How to make a script that gives in-game cash when i kill zombie?

you should just replace the current Blow() function with the one i sent.

It worked.
But when I hit zombie this happening

But nevermind this one is good too.

Thanks for your help! :smile:

1 Like

You need to add a debounce.

local debounce = false
function Blow(Hit)
    if debounce then return end
    debounce = true
	if not Hit or not Hit.Parent or not CheckIfAlive() then
		return
	end
	local RightArm = (Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand"))
	if not RightArm then
		return
	end
	local RightGrip = RightArm:FindFirstChild("RightGrip")
	if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
		return
	end
	local character = Hit.Parent
	local humanoid = character:FindFirstChild("Humanoid")
	if not humanoid then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if player and (player == Player or IsTeamMate(Player, player)) then
		return
	end
	UntagHumanoid(humanoid)
	TagHumanoid(humanoid, Player)
	humanoid:TakeDamage(Damage)

    if humanoid.Health <= 0 then
        local leaderstats = Player:WaitForChild("leaderstats")
        local cash = leaderstats:WaitForChild("Cash")
        cash.Value += ADDITIVE_VALUE
    end
    debounce = false
end
2 Likes

I need help about weapons too

getting in-game cash for killing zombies thing

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.