Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Killer Kills Everyone Script Not working? CRITICAL!

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
0
Answered by 10 years ago

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.

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. RobloxHelper49 55 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Try putting this in after stuff:

for i,player in pairs(game.Players:GetChildren()) do
    player:LoadCharacter() --Sets back to regular spawn.
end
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()? fireboltofdeath 635 — 10y

Answer this question