generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Need a line added to this script, please help.

Previous Thread :: Next Thread 
Ksenophon is not online. Ksenophon
Joined: 08 Apr 2017
Total Posts: 162
12 Oct 2017 03:33 PM
function Enter(newPlayer)
if newPlayer:IsInGroup(3517614) then
newPlayer.TeamColor=script.Parent.TeamColor
end
end


game.Players.ChildAdded:connect(Enter)




how do I make it where, it teams the person that is in the group that team color, then respawns them?

help will be appreciated
Report Abuse
RXTE95 is online. RXTE95
Joined: 29 Jun 2017
Total Posts: 169
12 Oct 2017 04:10 PM
there's an easier way to assign players to teams, this feature is actually in studio ready to go. if I understand you right, you want players to be automatically assigned to teams. in this case you would just add a leaderboard and then add teams under services and then add your spawns and set team colors and when someone joins it will automatically assign them to a team. there is other options in this such as switching teams etc.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
12 Oct 2017 04:15 PM
That's not even close to what he asked.. 😕

First, OP, you need to turn off CharacterAutoLoads. It's a property of the Players service.

Then, put this script in a server script inside the ServerScriptService

game.Players.PlayerAdded:connect(function(player)

if player:IsInGroup(3517614) then
player.Team = game.Teams["The Cool Kids"] -- or whatever your team name is
else
player.Team = game.Teams.Visitors
end

player.CharacterAdded:connect(function(char)
print("their character was loaded after their team was set")
end)

player:LoadCharacter()
end)
Report Abuse
iiNemo is online. iiNemo
Joined: 22 Jul 2013
Total Posts: 2380
12 Oct 2017 04:23 PM
local PS = game:GetService('Players') local TS = game:GetService('Teams') local GroupTeam = 'Nemo' local NonGroupTeam = 'Visitors PS.PlayerAdded:Connect(function(Player) if not ######################### #### ########### = TS[GroupTeam] else Player.Team = TS[NonGroupTeam] end Player:LoadCharacter() end) -- Considering if you even made 2 teams..
Report Abuse
RXTE95 is online. RXTE95
Joined: 29 Jun 2017
Total Posts: 169
13 Oct 2017 10:32 PM
Oh ok I see what he means now.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image