Okay, so this code ESSENTIALLY is SUPPOSED to end the round and kill all players once all players within the AliveCount table DIES accept the killer. It works... sort of.. after the killer kills 1 person it says the round ends even though there is another person alive. What's wrong with my script?
Also worth noting is all the objects in Alive is the players. They were placed there once the round started.
Ty for anyone who can help. This is really frustrating.
Also, if any of you ScriptingHelper LEECHERS are going to try and use my script for your own purposes: I HOPE YOU BURN IN HADES
--Killer Kills Everyone: THE BIG COMPLEX CODE--
for i,c in pairs(game.Players:GetPlayers()) do
for i,v in pairs(alive:GetChildren()) do
if c.Name == v.Name then
table.insert(aliveCount, v)
end
c.Character.Humanoid.Died:connect(function(died)
table.remove(aliveCount, i)
if #aliveCount == 1 then
--After Stuff--
for i,v in pairs(alive:GetChildren()) do
v.Head:remove()
end
print("The killer has killed EVERYONE. MUAHAHA!")
round.Value = ("gameover")
Temphint = Instance.new("Message", game.Workspace)
Temphint.Text = ("The Hitman has killed everyone. Hitman Wins!")
gameOverMusic3:Play()
killerGuiText:Destroy()
gameChosenClone:Destroy()
wait(5)
Temphint:Destroy()
RoundEndMain:Destroy()
end
end)
end
end

1 comment
I did spell everything correctly. If there was a typo i would've gotten an error. I didn't. It just doesn't work properly.