UgOsMiLy
|
  |
| Joined: 15 Sep 2009 |
| Total Posts: 2095 |
|
|
| 31 Oct 2013 04:22 AM |
How do I make this script that if someone spawns in a team, they get some gear
Reason: I want red team to have a red sword and Blur team to have a blue one
Can you help me out? |
|
|
| Report Abuse |
|
|
UgOsMiLy
|
  |
| Joined: 15 Sep 2009 |
| Total Posts: 2095 |
|
| |
|
UgOsMiLy
|
  |
| Joined: 15 Sep 2009 |
| Total Posts: 2095 |
|
| |
|
|
| 31 Oct 2013 05:49 AM |
--Put this is StarterPack Player = script.Parent.Parent if Player.TeamColor == "Really Red" then --You have to set the right color. game.Lighting.RedSword.Parent = Player.Backpack elseif Player.TeamColor == "Blue" then --You have to set the right color. game.Lighting.BlueSword.Parent = Player.Backpack end
|
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
|
| 31 Oct 2013 05:52 AM |
For example:
local teams = {} teams["Bright red"] = {"Red Sword", "Red Gun"} teams["Bright blue"] = {"Blue Sword", "Blue Gun"}
local tools = game.ServerStorage.Tools
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) player:WaitForChild("Backpack") if teams[player.TeamColor] then for i, tool in pairs(teams[player.TeamColor]) do if tools:findFirstChild(tool) then tools[tool]:Clone().Parent = player.Backpack end end end end) end) |
|
|
| Report Abuse |
|
|
UgOsMiLy
|
  |
| Joined: 15 Sep 2009 |
| Total Posts: 2095 |
|
| |
|
UgOsMiLy
|
  |
| Joined: 15 Sep 2009 |
| Total Posts: 2095 |
|
| |
|
|
| 03 Nov 2013 01:49 PM |
on a general term,
put script into starterpack and put weapons inside the script
if script.Parent.Parent.TeamColor == BrickColor.new("Really red") then for i,v in pairs(script:GetChildren()) do v.Parent = script.Parent end end |
|
|
| Report Abuse |
|
|
UgOsMiLy
|
  |
| Joined: 15 Sep 2009 |
| Total Posts: 2095 |
|
| |
|