while wait() do
local Players = game.Players:GetPlayers()
local MonsterKing = Players[math.random(1, #Players)]
if MonsterKing.name == not game.ServerStorage.LastMonsterKing.Value then
game.Players[MonsterKing.name].Team = game.Teams["Monster King"]
game.ServerStorage.LastMonsterKing.Value = MonsterKing.name
break
end
end
I'm trying to make it so that my game will randomly choose a player to be the monster king while making it so they were not the monster king last time.

1 comment
You don't name teams, you change the color of the team