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
 

Argument 2 missing or nil

Previous Thread :: Next Thread 
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 06:30 PM
wat is this error?
I have no second argument in my function
help
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Jul 2014 06:31 PM
Can you post part of the script and the line that is causing the error?
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 06:51 PM
i get two errors, either one of the two commented below
-------------------------------------------------------
user.Chatted:connect(function(m,chat)
newChat="";
if(string.sub(m,1,3)==bet)then
unfilter=function()--argument 2 missing or nil
for i,v in next,words do
chat=chat:gsub(i,v)end;end;
userchat:chat(user.Character.Head,unfilter(m),'Blue')--attempt to index upvalue 'chat'
end;
end);
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 Jul 2014 06:56 PM
user.Chatted:connect(function(m,chat)


The Chatted event only has 1 argument not 2
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 06:57 PM
o..
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 06:59 PM
i removed it and put it onto the unfilter function, I still get Argument 2 missing or nil on userchat:chat(user.Character.Head,unfilter(m) ','Blue');
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 Jul 2014 07:00 PM
http://wiki.roblox.com/index.php?title=RBX.lua.Chat_(Object)
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 07:14 PM
ok so this is new script
---------------------------
user.Chatted:connect(function(m)
if(string.sub(m,1,3)==bet)then
local chat;
for i,v in next,words do
chat=chat:gsub(i,v);
if(chat~=nil)then
userchat:chat(user.Character.Head,unfilter(m),'Blue')
end;
end;
end;
end);
----------------------------
Now I get this error:

attempt to index local 'chat'
wt do
!!
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
22 Jul 2014 07:18 PM
You never told the script what userchat is

userchat:chat

script; wut?????
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 07:20 PM
userchat = game:service'Chat';
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 07:21 PM
bump
help
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
22 Jul 2014 07:35 PM
bump
help
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