IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 22 Feb 2013 02:59 PM |
| When you chat the command ''!gamestart'' it sorts everyone into Red and Blue team, then kills everyone. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2013 03:03 PM |
Not sure if this'll work, but:
local keyMessage = "!gamestart" Game.Players.PlayerAdded:connect(function( Player ) Player.Chatted:connect(function( Chat ) if Chat:lower( ) == keyMessage then for i, v in pairs( Game.Players:GetPlayers( ) ) do if %i == 0 then v.TeamColor = BrickColor.new( "Bright red" ) else v.TeamColor = BrickColor.new( "Bright blue" ) end v.Character:BreakJoints( ) end end end ) end )
You'll have to add the admin specifications yourself.
¤ ¤ † K M <( •д• )> X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 22 Feb 2013 03:04 PM |
| Alright I'll test this, and I'm sure I can do that part, just the main function that I'm struggling with. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2013 03:05 PM |
One of the lines should be:
if i % 2 == 0 then
¤ ¤ † K M <( •д• )> X D † ¤ ¤
|
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
| |
|
|
| 22 Feb 2013 03:10 PM |
Yes.
¤ ¤ † K M <( •д• )> X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 22 Feb 2013 03:11 PM |
Would this work?
print("gamestart running")
local admins = {"iceorb"} local keyMessage = "!gamestart" Game.Players.PlayerAdded:connect(function( Player ) Player.Chatted:connect(function( Chat ) if Chat:lower( ) == keyMessage then for i, v in pairs( Game.Players:GetPlayers( ) ) do if i % 2 == 0 then v.TeamColor = BrickColor.new( "Bright red" ) else v.TeamColor = BrickColor.new( "Bright blue" ) end v.Character:BreakJoints( ) end end end ) end )
function onPlayerEntered(newPlayer) repeat wait() until newPlayer newPlayer.Chatted:connect(function(msg) for i = 1, #admins do if newPlayer.Name:lower() == admins[i] then onChatted(msg, newPlayer) end end end) end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
cart6157
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
|
| 22 Feb 2013 03:12 PM |
| Lol iceorb how many threads have you created questioning your script? |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
| |
|
|
| 22 Feb 2013 03:14 PM |
No, for one, there are technically two playeradded events. And you can't call my chatted function, as it's an anonymous function.
function onChatted( Chat, Player ) if Chat:lower( ) == keyMessage then for i, v in pairs( Game.Players:GetPlayers( ) ) do if i % 2 == 0 then v.TeamColor = BrickColor.new( "Bright red" ) else v.TeamColor = BrickColor.new( "Bright blue" ) end v.Character:BreakJoints( ) end end end
function onPlayerEntered(newPlayer) repeat wait() until newPlayer newPlayer.Chatted:connect(function(msg) for i = 1, #admins do if newPlayer.Name:lower() == admins[i] then onChatted(msg, newPlayer) end end end) end Game.Players.PlayerAdded:connect(onPlayerEntered)
Something like this. . .
¤ ¤ † K M <( •д• )> X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 22 Feb 2013 03:18 PM |
| Yeah just realised I left your chat function. |
|
|
| Report Abuse |
|
|