#i just wanna know why my script doesnt emit a message when there 0 players in a team.
1 messages · Page 1 of 1 (latest)
try do delete # from selected line
bc you already have number of players in humans team
i also deleted unnecessary wait()s
use task.wait instead
local Laugh = game.StarterGui.Laugh
game.Players.PlayerAdded:Connect(function(plr)
local function winMessage(allPlayersCount)
print("Team is empty")
Laugh:Play()
local msg = Instance.new("Message",workspace)
msg.Text = "HAHAHHAHHH, ALL HUMANITY IN THE UNIVERSE HAS BEEN COMPLETLY WIPED BY ALIENS!! >:D"
workspace.Sound:Stop()
task.wait(5)
msg:Destroy()
workspace.Sound:Play()
for _, player in ipairs(allPlayersCount) do
player.Team = team
end
end
plr.CharacterAdded:Connect(function(crh)
crh.Humanoid.Died:Connect(function()
warn("died")
plr.Team = game.Teams.Aliens -- idk do that somehow
local allPlayersCount = #game.Teams.Humans:GetChildren()
if #allPlayersCount <= 0 then
winMessage(allPlayersCount)
script.Parent.GameIsEnded.Value = true
else
print("Team has "..allPlayersCount.." players")
end
end)
end)
end)
broski finally polished his own polishing 😭