IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:20 AM |
I want it so that when I say "!gamestart!'' it will randomise the teams and kill them, so they can start.
print("gamestart running") ---------------------- local admins = {"iceorb"}
function onChatted(msg, speaker) source = string.lower(speaker.Name) if msg == "!gamestart" then _G.Teams = {} _G.Teams["Red"] = {} _G.Teams["Blue"] = {} local plrs=randomizetable(game.Players:GetChildren()) for i,v in ipairs(plrs) do if v~=nil and v.Parent~=nil then local t = (i%(#teams))+1 v.TeamColor=teams[t].color _G.Teams[teams[t].name][v.Name] = v 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 |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:24 AM |
| Anyone know how to sort it out? |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
| |
|
cart6157
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
|
| 21 Feb 2013 06:34 AM |
Try this function:
game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) script end) end) |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:35 AM |
| What replace that at the top? |
|
|
| Report Abuse |
|
|
cart6157
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
|
| 21 Feb 2013 06:35 AM |
| Oh my bad I just flew through the script :P |
|
|
| Report Abuse |
|
|
cart6157
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
|
| 21 Feb 2013 06:38 AM |
| Edit iceorb to Player1 and test it in play solo. Tell me if something pops up in the output. |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:38 AM |
| Lool, what now :S I'm confused :( |
|
|
| Report Abuse |
|
|
cart6157
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
|
| 21 Feb 2013 06:40 AM |
Wait a sec, if you want this to run when you say'!gamestart!' then you'll have to write this:
if msg == '!gamestart!' then
You had:
if msg == '!gamestart' then
|
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:41 AM |
| Alright I did that, but, nothing displayed it just said ''gamestart running'', but when I enter in game, and say !gamestart it doesn't seem to sort the teams. |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:42 AM |
| Noo I want it to start when I say " !gamestart " that was a typo! |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 06:47 AM |
| Not sure what to do, maybe the whole script needs to be re-written. |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2013 07:18 AM |
>I want it so that when I say "!gamestart!"
>if msg == "!gamestart" then
Tactical Rainboom Inbound |
|
|
| Report Abuse |
|
|
cart6157
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
| |
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 07:28 AM |
| It was meant to be ''!gamestart" |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 21 Feb 2013 07:28 AM |
| Look all I'm trying to do is get it to get the players from the neutral team and sort them into red and blue! and then it kills them so the game starts. |
|
|
| Report Abuse |
|
|