So far, I've only managed to make the gun keep track of kills. But I want to make the grenades and the knife keep track of kills also. I don't know how to do that. BTW here is the knife script:
local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local Slash = script:WaitForChild("Slash")
local Debounce = false
local PlayersHit = {}
local stabSFX = script.Parent.Handle["Knife Stab 3 (SFX)"]:Clone()
stabSFX.Parent = script.Parent
Tool.Activated:Connect(function()
if Debounce ==false then
Debounce = true
local Humanoid = Tool.Parent:WaitForChild("Humanoid")
local AnimTrack = Humanoid:LoadAnimation(Slash)
AnimTrack:Play()
stabSFX:Play()
wait(0.7) --Cooldown for next Slash
Debounce = false
end
end)
Handle.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent ~= Tool.Parent then
if Debounce == true and PlayersHit[Hit.Parent] == nil then
Hit.Parent:FindFirstChild("Humanoid"):TakeDamage(80) --This is the amount of health taken away from one hit
PlayersHit[Hit.Parent] = true
wait(1)
PlayersHit[Hit.Parent] = nil
end
end
end)
** You are now Level 2! **