|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 02 Oct 2013 10:43 PM |
| GetRankInGroup, or GetRoleInGroup with if statements, and CharacterAdded. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|