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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: I'm trying to make a script

Previous Thread :: Next Thread 
ravioli_formioli is online. ravioli_formioli
Joined: 25 Feb 2016
Total Posts: 3887
08 Aug 2017 05:08 PM
I want it to make all members of a group join 'Black' Team, except if they are the first rank they will join 'Smoky grey' instead. There is also a third 'White' team which is autoassignable and is for people who are not in the group at all.

So far, someone gave me this but it doesnt seem to be working.



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

if plyr:GetRankInGroup(ID) == 1 then


plyr.TeamColor = BrickColor.new("Smoky grey")


else plyr.TeamColor = BrickColor.new("Black")


end)
Report Abuse
ravioli_formioli is online. ravioli_formioli
Joined: 25 Feb 2016
Total Posts: 3887
08 Aug 2017 05:11 PM
(i copied a version where i hadnt put the ID in yet but it does have the ID in the main one thats not the issue lol)
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
08 Aug 2017 05:13 PM
wiki.roblox.com/index.php?title=Output
Report Abuse
Prenup is not online. Prenup
Joined: 26 Dec 2015
Total Posts: 1140
08 Aug 2017 05:15 PM
game.Players.PlayerAdded:connect(function(plyr)

if plyr:GetRankInGroup(ID) == 1 then


plyr.TeamColor = BrickColor.new("Smoky grey")


else plyr.TeamColor = BrickColor.new("Black")

end

end)
Report Abuse
ThanksRoBama is not online. ThanksRoBama
Joined: 21 May 2017
Total Posts: 127
08 Aug 2017 05:20 PM

local GroupS = game:GetService("GroupService")

local groupId = 3392928
local groupInfo = GroupS:GetGroupInfoAsync(groupId)

local blackTeamMinRank = 7
local greyTeamMinRank = 1

game.Players.PlayerAdded:Connect(function(player)
local rank = player:GetRankInGroup(groupId)
local teamColor

if rank >= blackTeamMinRank then
teamColor = "Black"
elseif rank >= greyTeamMinRank then
teamColor = "Smoky grey"
else
teamColor = "White"
end

player.TeamColor = BrickColor.new(teamColor)
end)
Report Abuse
ravioli_formioli is online. ravioli_formioli
Joined: 25 Feb 2016
Total Posts: 3887
08 Aug 2017 05:41 PM
Thanks robama lol. it worked.
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