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 » Scripters
Home Search
 

Attempt to Index a number value

Previous Thread :: Next Thread 
LinurS is not online. LinurS
Joined: 19 Jul 2017
Total Posts: 6
11 Aug 2017 06:03 AM
On this line I get the error attempt to index a number value, I've tried what I could do but nothing would work any help? Here is the line:

stock.Value = tostring(stockdatastore:GetAsync("stockowned_"..plr.UserId.."_"..i)[1])



https://www.roblox.com/groups/group.aspx?gid=2988707
Report Abuse
Dadosayhi is not online. Dadosayhi
Joined: 05 Jul 2011
Total Posts: 272
11 Aug 2017 06:53 AM
your data is saved as a number instead of a table
Report Abuse
sonihi is not online. sonihi
Joined: 27 Jun 2009
Total Posts: 3655
11 Aug 2017 06:54 AM
Is stock a number value? then you should do


stock.Value = tonumber(stockdatastore:GetAsync("stockowned_"..plr.UserId.."_"..i)[1])
Report Abuse
LinurS is not online. LinurS
Joined: 19 Jul 2017
Total Posts: 6
11 Aug 2017 06:57 AM
yes, I've figured out what was wrong. I was saving it wrongly. I was doing stockdatastore:SetAsync("stockowned_"..plr.UserId.."_"..i)[1]) = somevalue


https://www.roblox.com/groups/group.aspx?gid=2988707
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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