Im trying to make a Kill streak system while using the “creator” ObjectValue, so in 5 seconds, if Kills = 3 then the player will be awarded with a badge, but for now being a print function.
Why did I get this error though/
Script
local RunService = game:GetService("RunService")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
if character.Humanoid:FindFirstChild("creator") then
local Player = character.Humanoid.creator.Value
local killerCharacter = Player:GetCharacterFromPlayer(Player)
local Kills = killerCharacter:WaitForChild("kills")
Kills += 3
local creator = character.Humanoid:FindFirstChild("creator")
while task.wait() do
if creator and killerCharacter then
task.wait(6)
if Kills == 3 then
print("yay")
end
end
end
end
end)
end)
end)