I want to make a game where four players must run from one (player) monster while completing tasks. I want the selection of the monster to be random, so I used a bindable event to determine that the round starts when all five players join. The script, however does not work and nobody gets teamed. No errors are in the console.
local repStorage = game:GetService("ReplicatedStorage") local event = repStorage:WaitForChild("RoundStart") local players = game.Players:GetPlayers() while true do if #players == 5 then event:Fire() end wait(.01) end
Script that fires the event ^^^
local repStorage = game:GetService("ReplicatedStorage") local event = repStorage:WaitForChild("RoundStart") event.Event:Connect(function() local var = game.Players:GetPlayers() local monster = var[math.random(1, #var)] monster.TeamColor = BrickColor.new("Really red") --color of monster team end)
Team script ^^^