i have a script that selects one person to be a killer and the rest to be runners. I need it so once the killer has been selected it changes their team to bright red and once the runners have been selected to change their team to bright blue.
Script That needs editing:
players = game.Players:GetChildren() randomp = players[math.random(#players)] print(randomp.Name .. " is killer") game.Player.TeamColor = "Bright red"; for i,v in pairs(players) do if v.Name ~= randomp.Name then print(v.Name .. " is runner") game.Players.TeamColor = "Bright blue"; end end
This code is okay, but the only thing that goes wrong is setting the TeamColor. TeamColor is a BrickColor and should therefore receive a BrickColor:
players = game.Players:GetChildren() randomp = players[math.random(#players)] print(randomp.Name .. " is killer") game.Player.TeamColor = BrickColor.new("Bright red"); for i,v in pairs(players) do if v.Name ~= randomp.Name then print(v.Name .. " is runner") game.Players.TeamColor = BrickColor.new("Bright blue"); end end