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

Killer Kills Everyone Script Not working? CRITICAL!

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

2 answers

To be honest, I don't understand this script. It's not your fault it's just my limited knowledge of Lua. Try seeing if you've spelled the words correctly and make sure there is capitals in the right place.

Hope this helps.

1 comment

0

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.

Try putting this in after stuff:

for i,player in pairs(game.Players:GetChildren()) do
	player:LoadCharacter() --Sets back to regular spawn.
end

1 comment

0

Is this full code? If not then it should be fine else if it isn't.... Is there any variable "alive" for alive:GetChildren()?

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