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: How would I make it so one team

Previous Thread :: Next Thread 
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
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
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
26 Dec 2013 06:20 PM
Or backpack I mean.
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
26 Dec 2013 07:25 PM
??
Report Abuse
Goulstem is not online. 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
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
27 Dec 2013 05:35 AM
thxdoes that script go in workspace?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
27 Dec 2013 05:41 AM
Yes it does.
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
28 Dec 2013 08:14 AM
Thx for trying, but it didn't work.
Report Abuse
MarioKartAddict is not online. MarioKartAddict
Joined: 11 Nov 2009
Total Posts: 42774
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
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
28 Dec 2013 05:25 PM
Mario,
It doesn't work I tried.
Report Abuse
Rrrrry123 is online. 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
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