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: Error in argument 1

Previous Thread :: Next Thread 
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 12:40 PM
Sname = Game:GetService("MarketplaceService"):GetProductInfo(ID).Name

I see no error in my argument
Can anyone explain?
Report Abuse
BIackHoIe is not online. BIackHoIe
Joined: 23 Aug 2012
Total Posts: 68
21 Jun 2013 12:48 PM
Maybe ID is nil?

Can you give me the exact error?
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 12:49 PM
12:49:10.960 - Argument 1 missing or nil
12:49:10.961 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 43
12:49:10.961 - stack end

ID works
Report Abuse
BIackHoIe is not online. BIackHoIe
Joined: 23 Aug 2012
Total Posts: 68
21 Jun 2013 12:51 PM
ID must be nil. Can you show me your entire script?
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 12:55 PM
Alright, pastebin /SsX9pzzp

And ID is valid, unless I messed it up with function
Report Abuse
BIackHoIe is not online. BIackHoIe
Joined: 23 Aug 2012
Total Posts: 68
21 Jun 2013 12:59 PM
Well assuming lines 5,6,7 worked fine, I see no problem.
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 01:04 PM
.-.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
21 Jun 2013 01:11 PM
use
local Sstats = Game.Lighting.StockStats

dont use
Sstats = Game.Lighting.StockStats
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
21 Jun 2013 01:18 PM
I believe 'argument 1' actually refers to either the object or the method you are calling (unsure which).
Print every part to see where the issue is:

print(Game);
print(Game:GetService("MarketplaceService"));
print(Game:GetService("MarketplaceService"):GetProductInfo(ID));
print(Game:GetService("MarketplaceService"):GetProductInfo(ID).Name);
Sname = Game:GetService("MarketplaceService"):GetProductInfo(ID).Name
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 01:30 PM
OUTPUT:
Place1
MarketplaceService
13:28:08.760 - Argument 1 missing or nil
13:28:08.761 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 44
13:28:08.761 - stack end

so it would seem the problem is with id.

so is the problem

ID = script.aID.Value

and should I change it to

ID = script.Parent.Script.aID.Value

?
ID was working fine before I put function around variables :/

-Cold
Report Abuse
BAUER102 is not online. BAUER102
Joined: 03 Apr 2010
Total Posts: 5936
21 Jun 2013 01:33 PM
Put in a print(ID) before your GetProductInfo call and post the result.
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
21 Jun 2013 01:35 PM
You can't assign a property to a variable.

~ Add 6276 posts to my post count ~
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 01:35 PM
Place1
MarketplaceService
nil
13:34:15.660 - Argument 1 missing or nil
13:34:15.660 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 45
13:34:15.660 - stack end

interesting. The ID is nil, so then it must be Game:GetService("RunService").Stepped:connect(function()
--variables
end)

that's breaking it.
what do

-Cold
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 01:37 PM
Usering, how has been working for me then?
it's making the value = the value of intvalue

-Cold
Report Abuse
BAUER102 is not online. BAUER102
Joined: 03 Apr 2010
Total Posts: 5936
21 Jun 2013 01:39 PM
Ignore usering, he's talking trash.

I'll rewrite your code and check if it's working then.
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
21 Jun 2013 01:39 PM
The .Value is a property and you can't specify it in a variable.

~ Add 6276 posts to my post count ~
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
21 Jun 2013 01:43 PM
"Ignore usering, he's talking trash."

instead of being so uptight, how about just ignoring it like everyone else; so what I made a mistake, big deal

~ Add 6276 posts to my post count ~
Report Abuse
BAUER102 is not online. BAUER102
Joined: 03 Apr 2010
Total Posts: 5936
21 Jun 2013 01:54 PM
This seems to work for me.

pastebin/Ap8m3W00

Also, are you sure that you need to fetch the results every frame?
You aren't using them this often.
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 02:07 PM
every 15 seconds i need to update
so that can be changed

-Cold
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 02:14 PM
Bauer,
Although that works, it works the same as what I had before.

I want RAverage to update every 15 seconds and Average to update every hour

also, now line 10 and 16 have errors in output


-Cold
Report Abuse
BAUER102 is not online. BAUER102
Joined: 03 Apr 2010
Total Posts: 5936
21 Jun 2013 02:15 PM
'also, now line 10 and 16 have errors in output'

in that case, you messed something up with the setting up of it

it didn't error for me

post the errors?
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 02:16 PM
actually not 10 and 16

holy mother of outputs :o


14:15:09.535 - Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg:9: bad argument #1 to 'gsub' (string expected, got nil)
14:15:09.535 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 9
14:15:09.535 - stack end
14:15:09.560 - RawCallback error
14:15:09.560 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 4
14:15:09.561 - stack end
14:15:09.563 - RawCallback error
14:15:09.563 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 5
14:15:09.563 - stack end
14:15:09.566 - RawCallback error
14:15:09.566 - Script "Players.Player1.PlayerGui.StockGuides.Main.hat1.Avg", Line 6
14:15:09.566 - stack end

-Cold
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
21 Jun 2013 02:49 PM
So

Whats the issue now

-Cold
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