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 do i make a function

Previous Thread :: Next Thread 
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
20 Apr 2014 03:56 PM
that takes people in a server and splits them in half and one side changes team to Really Blue and other to New Yeller?

function Teams()
GetPPL = game.Players:GetChildren()

end


Then idk

☣ ~ You better make it quick! Or I will rip off your head... ~ ☣
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
20 Apr 2014 03:59 PM
bump

☣ ~ You better make it quick! Or I will rip off your head... ~ ☣
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 04:02 PM
get the num of players using game.Players.NumPlayers



then put [number] on one and [number] on other.

I got pecked by TWO chicken's!
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
20 Apr 2014 04:16 PM
function choose()
PN = game.Players.NumPlayers == 10 then
-- how do I take the 5?
end

☣ ~ You better make it quick! Or I will rip off your head... ~ ☣
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
20 Apr 2014 04:18 PM

function choose()
PN = game.Players.NumPlayers
if PN.ganePlayers.NumPlayers == 10 then
-- how do I take the 5?
end

☣ ~ You better make it quick! Or I will rip off your head... ~ ☣
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Apr 2014 04:21 PM
Rebalance = function (Plrs)
Num = game.Players.NumPlayers
half = Num/2
for I=1, Num do
if I >=half then
Plrs [I].TeamColor = team1.TeamColor
else
Plrs [I].TeamColor = team2.TeamColor
end
end
end
Rebalance (game.Players:GetPlayers ())

Work from there? XD
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
20 Apr 2014 04:29 PM
Ummm

Rebalance = function (Plrs)
Num = game.Players.NumPlayers
half = Num/2
for I=1, Num do
if I >=half then
Plrs [I].TeamColor = team1.TeamColor
else
Plrs [I].TeamColor = team2.TeamColor
end
end
end
Rebalance (game.Players:GetPlayers ())

I don't understand Plrs xD?

☣ ~ You better make it quick! Or I will rip off your head... ~ ☣
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Apr 2014 04:31 PM
Dude, my script will put half on one team, and half on other.....

And thats all ya need to know right now XD, cuz im on mobile :P
Report Abuse
MTamidex is not online. MTamidex
Joined: 17 Oct 2013
Total Posts: 1092
20 Apr 2014 04:35 PM
This should help. You gotta CFrame. About the division idk.


http://wiki.roblox.com/index.php?title=Teleportation
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
20 Apr 2014 04:40 PM
Here's an attempt lol

table = {
}

b = 0
r = 0

game.Players.PlayerAdded:connect(function(plr)
table.insert(table, plr.Name)
end)

function teamB(plr)
plr.TeamColor = BrickColor.new("Bright blue")
end

function teamR(plr)
plr.TeamColor = BrickColor.new("Bright red")
end

s = math.random(1,#table)
b = table[s]
r = table[s]

repeat
b = b+1
table.remove(table, b)
table.remove(table, r)
r = r+1
teamB(tostring(b)
teamR(tostring(r)
until b >= game.Players.NumPlayers/2 and r >= game.Players.NumPlayers/2 and #table <= 0

Something like this?
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Apr 2014 04:45 PM
My script is perfect >_<
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
20 Apr 2014 04:46 PM
I do believe I got your script xD

☣ ~ You better make it quick! Or I will rip off your head... ~ ☣
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