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: What's wrong with this script? :(

Previous Thread :: Next Thread 
IceOrb is not online. 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 is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
21 Feb 2013 06:24 AM
Anyone know how to sort it out?
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
21 Feb 2013 06:31 AM
qq :(
Report Abuse
cart6157 is not online. 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 is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
21 Feb 2013 06:35 AM
What replace that at the top?
Report Abuse
cart6157 is not online. 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 is not online. 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 is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
21 Feb 2013 06:38 AM
Lool, what now :S I'm confused :(
Report Abuse
cart6157 is not online. 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 is not online. 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 is not online. 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 is not online. 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
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
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 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
21 Feb 2013 07:23 AM
Cooldude read the thread.
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
21 Feb 2013 07:28 AM
It was meant to be ''!gamestart"
Report Abuse
IceOrb is not online. 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
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