I'm trying to make only my certain accounts join one of my teams called owner and i set up a variable for the accounts names to be identified as owners. here's what i did but I cant figure out a code to use from here on out.
1 CreateNewTeam = game.Teams.Owner() 2 Owners = "illuminatidrag0ns0ul, JohnDoeVs1x1x1x1kid" 3 local Connect = JoinTeam 4 JoinTeam = game.Teams["Guest Pwners"]:GetPlayers(Owners)PutPlayers:Owner
Line 1 create a variable that specifies the Owner team... no it's not that I want to create a new team, I already have one
Line 2 Create a variable that specifies 2 specific players
Line 3-4 ik thats not actually code but im trying to say that when the function is called upon when the players join the game, they get switched from the default team "Guest Pwners" to the "Owner" team.
Someone plz help!, once I get this script running I will be able to launch my game "Guest Fest" into alpha!
-Side note: Im mostly concerned about lines 3-4 so if you could possible make it work while keeping lines 1 and 2 intact that would be great! But if you notice any mistakes and can't see a way around alteration please point them out... I started scripting 3 days ago. Before that My brother was maintaining the scripting, but he moved and let me access the account.
Hello, here is how I did it.
game.Players.PlayerAdded:connect(function(player) --Runs if player is added and stores player if player.Name == "illuminatidrag0ns0ul" or "JohnDoeVs1x1x1x1kid" then --Checks if player.Name equals any of your account names player.TeamColor = BrickColor.new("ColorOfTeamHere") --Changes the players team color to the color of the team end end)
Hope it helps!
EDIT:
I figured out that you need two teams, 1 of them to be auto assignable and your owner team to not be. Then it should work.
Sorry to tell you this but it still does not work. file:///C:/Users/LoganTheGreat/Pictures/Roblox/RobloxScreenShot20180626_004427026.png