Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my kill counter not applying the kills?

I made a kill counter but it isn't doing anything when you kill someone. Perhaps it is something wrong with the script? Addkill is a localscript

local addkill = game.ReplicatedStorage.AddKill

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		Character:WaitForChild("Humanoid").Died:Connect(function()
			local oof = Character.Humanoid:FindFirstChild("creator")
			if oof ~= nil then
				if oof.Value ~=nil then
				addkill:Clone().Parent = game.StarterPack
			end
		end
	end)
end)
end)

or is it something wrong with the localscript

wait(1)
local plr = game.Players.LocalPlayer.StarterPack.Kills
if script.Parent == game.StarterPack then
	plr.Value = plr.Value + 1
	print("kill")
	wait(0.1)
	script:Destroy()
end

Kills is a numbervalue

1 comment

0

StarterPack is neither a child nor a descendant of player objects

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.