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: Re:

Previous Thread :: Next Thread 
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 02:58 PM
function randomiseteam()
for i, v in pairs( Game.Players:GetPlayers( ) ) do
if v.TeamColor == BrickColor.new( "Sand green" ) then
if i % 2 == 0 then
v.TeamColor = BrickColor.new( "Bright red" )
else
v.TeamColor = BrickColor.new( "Bright blue" )
wait(2)
v:LoadCharacter()
end
end
end
end

Doesn't seem to be rebalancing the teams at all?
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 03:08 PM
Sorry!! Completely wrong script!
It was this one I was meant to paste :

function pistolandassult()
local weapona = game.Lighting.Y14
for i = 1, #players do
weapona:clone().Parent = game.Players:FindFirstChild(players[i]).Startergear
end
end

That isn't working for some reason?
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
01 Jun 2013 03:11 PM
Assuming players is defined, and contains the players.

weapona:clone().Parent =players[i].Startergear

Not sure if the 'g' in starter gear is capitalized, and did you want to put it into the backpack?
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 03:13 PM
No, the g in starter gear isn't capitalised, and well, I just want to put it in an area where it will continously give the weapons towards the all the players. Maybe starterpack?
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
01 Jun 2013 03:16 PM
Oh right, it's StarterPack. Just change Startergear in my line to StarterPack and you should be good.
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 03:18 PM
Wait! "players" isn't defined!
Report Abuse
Astrae is not online. Astrae
Joined: 05 Mar 2013
Total Posts: 2386
01 Jun 2013 03:18 PM
You only get Startergear when you reset. Make sure you add the tools to both Startergear AND starterpack at first.

#RS>Euro/GW/LOTV/TS/STF/GRMVA
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
01 Jun 2013 03:18 PM
Then define it.

player = game.Players:getPlayers()
Report Abuse
Astrae is not online. Astrae
Joined: 05 Mar 2013
Total Posts: 2386
01 Jun 2013 03:20 PM
function AwardWeapons(weapon)
for _, plyr in pairs(game.Players:GetPlayers()) do
weapon:Clone().Parent = plyr.Startergear
weapon:Clone().Parent = plyr.StarterPack
end
end

AwardWeapons(game.Lighting.Y14)

#RS>Euro/GW/LOTV/TS/STF/GRMVA
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 03:25 PM
If it just cloens to startergear, would that still work on giving weapons each time a player dies?
Report Abuse
Astrae is not online. Astrae
Joined: 05 Mar 2013
Total Posts: 2386
01 Jun 2013 03:26 PM
If it only clones to Startergear, they will be given weapons when they die.

#RS>Euro/GW/LOTV/TS/STF/GRMVA
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 03:35 PM
Yeah, but my script also does LoadCharacter() - so it should give them.
Anyways, would this work? I changed a few bits in your script:

function pistolassault()
for _, plyr in pairs(game.Players:GetPlayers()) do
a = game.Lighting.Y14:Clone()
a.Parent = plyr.Startergear
b = game.Lighting.W17:Clone()
b.Parent = plyr.Startergear
end
end
Report Abuse
Astrae is not online. Astrae
Joined: 05 Mar 2013
Total Posts: 2386
01 Jun 2013 03:46 PM
try it

#RS>Euro/GW/LOTV/TS/STF/GRMVA
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 03:51 PM
Am I able to parent the clone to to areas at once?
like
a.Parent = game.StarterPack
a.Parent = plyr.Backpack
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 04:02 PM
Alright sorted it out --
Just wondering
If I do this
a = game.Starterpack:GetChildren()
a:destroy()

will it destroy all tools within that?
Report Abuse
StoneVI is not online. StoneVI
Joined: 01 Jun 2012
Total Posts: 174
01 Jun 2013 04:03 PM
yea, should do
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 04:10 PM
So this should work?

function removetools()
tools = (game.StarterPack:GetChildren())
tools:Destroy()
end
Report Abuse
shutupkoolman is not online. shutupkoolman
Joined: 11 Sep 2011
Total Posts: 3734
01 Jun 2013 04:25 PM
function pistolandassult()
for i,v in pairs(game.Players:children()) do
local weapon = game.Lighting.Y14
weapon:Clone().Parent = v.Backpack
weapon:Clone().Parent = v.StarterGear (yes, the G is capitol)
end
end

function removetools()
for i,v in pairs(game.Players:children()) do
for q,s in pairs(v.Backpack:children()) do
s:Remove()
end
for q,s in pairs(v.StarterGear:children()) do
s:Remove()
end
end
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 04:27 PM
That won't help as the W17 and Y14 are within the starterpack.
Report Abuse
shutupkoolman is not online. shutupkoolman
Joined: 11 Sep 2011
Total Posts: 3734
01 Jun 2013 04:31 PM
A player's startergear saves a weapon until it is removed.
A player's backpack is what the person has currently, which can be given through startergear.
The game service "StarterPack" is where a weapon is placed into every player's startergear, thus going to the backpack.
If you place a weapon into startergear, it does not go to the starterpack but still will always go to the backpack if a player resets.
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
01 Jun 2013 04:46 PM
Yes, I know what each property is haha, I've cloned it to starterpack.
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