Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I change specific Players to a team of my choosing upon joining?

Asked by 5 years ago

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.

0
I am wondering where do i put the script and what type of script (by the way im completely new to scripting so i am very helpless) Fortbloxbattleroyal1 0 — 4y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

0
I just Wanted to say thank you! but I also have a question... Does it matter where I place this script? If so where? Under workplace or under the spawn loaction or under players? illuminatidrag0ns0ul 2 — 5y
0
It doesn't matter where you put it! I recommend the serverScriptService DogeDark211 81 — 5y
0
Hey DogeDark, i just put the script into my game today and everybody joined the Owner team, even though i i changed the team color to illuminatidrag0ns0ul 2 — 5y
0
Hey DogeDark, i just put the script into my game today and everybody joined the Owner team, even though i changed the team color to Magenta. then changed it in the script, everyone joined the Owner team instead of just the account specified illuminatidrag0ns0ul 2 — 5y
View all comments (2 more)
0
There, edited my answer. Hopefully that works. DogeDark211 81 — 5y
0
Yeah the script doesnt work still, same problem with everyone going to the owner team, think about vehicle simulator when Sim joins the game and suddenly the Mayor team pops up for him illuminatidrag0ns0ul 2 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Sorry to tell you this but it still does not work. file:///C:/Users/LoganTheGreat/Pictures/Roblox/RobloxScreenShot20180626_004427026.png

0
nvm the file doesnt work, but its ok it was just a pic of an alt account in the owners team when i joined illuminatidrag0ns0ul 2 — 5y

Answer this question