Hi guys, I’m currently making a game but because I’m not a scripter so have been hitting some dead ends. I was just trying to make it so in the intermission phase of the game, players can choose their teams and characters then when the game starts they will spawn accordingly. I’m also making this using script in serverscriptservice. Here is the code for the game start:
local function StartGame()
game.Players.PlayerAdded:Connect(function(plr) if plr.Team == "Zombie" then SpawnZombie() elseif plr.Team == "Civ" then SpawnCiv() elseif plr.Team == "Police" then SpawnPolice() end end)
Here script for intermission:
re.OnServerEvent:Connect(function(plr, teamname) if teamname == "Zombie" then plr.Team = game.Teams.Zombies elseif teamname == "Civ" then plr.Team = game.Teams.Civilians elseif teamname == "Police" then plr.Team = game.Teams.Polices end end)
I have been searching online many times but to no avail I can’t find anything useful or maybe I don’t understand but I hope someone can help me become better. Thanks a lot!