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 » Scripting Helpers
Home Search
 

Re: Making certain Ranks Span with things

Previous Thread :: Next Thread 
patrickredsox0625 is not online. patrickredsox0625
Joined: 13 Feb 2010
Total Posts: 104
29 Sep 2013 05:37 PM
Hello,

I own a clothing company and I want o make it so if you are a certain rank you spawn with this set of tools, this rank with another, and this rank with another. I believe there is a total of 3 ranks I want to spawn with their own set of tools. 2 of those ranks spawning with the exact same thing.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Sep 2013 05:48 PM
local groupId = 100;
getfenv()['set of tools'] = {
     ['Set 1'] = Game.Lighting.Set1:GetChildren();
     ['Set 2'] = Game.Lighting.Set1:GetChildren();
     ['Set 3'] = Game.Lighting.Set1:GetChildren();
}

game['Players']['PlayerAdded']:connect(function(p)
     p['CharacterAdded']:connect(function(c)
          local role = p:GetRoleInGroup(groupid)
          if role == "Rank 1" then
               table['foreach'](getfenv()['set of tools']['Set 1'],
                     function(i,v)
                         v:Clone().Parent = p['Backpack']
                    end
               )
     elseif role == "Rank 2" then
          table['foreach'](getfenv()['set of tools']['Set 2'],
                     function(i,v)
                         v:Clone().Parent = p['Backpack']
                    end
               )
     elseif role == "Rank 3" then
          table['foreach'](getfenv()['set of tools']['Set 3'],
                     function(i,v)
                         v:Clone().Parent = p['Backpack']
                    end
               )
     end
end)
end)
Report Abuse
patrickredsox0625 is not online. patrickredsox0625
Joined: 13 Feb 2010
Total Posts: 104
02 Oct 2013 10:40 PM
Holy...Crap..I don't even know where to begin. I will try to work with this, thank you.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
02 Oct 2013 10:43 PM
GetRankInGroup, or GetRoleInGroup with if statements, and CharacterAdded.
Report Abuse
patrickredsox0625 is not online. patrickredsox0625
Joined: 13 Feb 2010
Total Posts: 104
03 Oct 2013 11:12 AM
Do I put the names of the tools in lighting in here?:

['Set 1'] = Game.Lighting.Set1:GetChildren(tool);
['Set 2'] = Game.Lighting.Set1:GetChildren(tool);
['Set 3'] = Game.Lighting.Set1:GetChildren(tool);
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
03 Oct 2013 12:08 PM
Why did you even need so use setfenv?

You just want to show of your scripting skills by defining a variable with spaces in it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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