|
| 26 Dec 2013 06:12 PM |
| has certain weapon and the other team has a different weapon? Hopperbin in the spawn or team? Anyone know? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 26 Dec 2013 07:31 PM |
Put the wanted tools for each team inside the teams(parent the tools by the wanted team)
function onPlayerAdded(player) player.CharacterAdded:connect(function() for _, team in pairs(game:GetService("Teams"):GetChildren()) do if team.TeamColor == player.TeamColor then for _, instance in pairs(team:GetChildren()) do instance:Clone().Parent = player.Backpack end end end end) end
for _, player in pairs(game.Players:GetPlayers()) do onPlayerAdded(player) end
game.Players.PlayerAdded:connect(onPlayerAdded)
|
|
|
| Report Abuse |
|
|
|
| 27 Dec 2013 05:35 AM |
| thxdoes that script go in workspace? |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Dec 2013 08:14 AM |
| Thx for trying, but it didn't work. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 10:06 AM |
| Can't you just add a Backpack in each Team and put the weapons you want in there? |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2013 05:25 PM |
Mario, It doesn't work I tried. |
|
|
| Report Abuse |
|
|
Rrrrry123
|
  |
| Joined: 23 Nov 2009 |
| Total Posts: 93 |
|
|
| 28 Dec 2013 05:32 PM |
I have this script. Put it in Workspace and put the tools in the teams. Usually works. (Note: You must be in online mode for this to work)
--Just put weapons in the team. function teamFromColor(color) for _,t in pairs(game:GetService("Teams"):GetChildren()) do if t.TeamColor==color then return t end end return nil end
function onSpawned(plr) local tools = teamFromColor(plr.TeamColor):GetChildren() for _,c in pairs(tools) do c:Clone().Parent = plr.Backpack end end
function onChanged(prop,plr) if prop=="Character" then onSpawned(plr) end end
function onAdded(plr) plr.Changed:connect(function(prop) onChanged(prop,plr) end) end
game.Players.PlayerAdded:connect(onAdded)
I use this on my AVATAR game. Works great! |
|
|
| Report Abuse |
|
|