Jump to content

Bad argument.GivePlayerMoney.


Bzz335

Recommended Posts

  
local money={ 
[1]={math.random(150,400)}, 
[2]={math.random(400,600)}, 
[3]={math.random(600,800)}, 
[4]={math.random(800,1000)}, 
[5]={math.random(800,1000)}, 
[6]={math.random(800,1000)}, 
} 
  
function moneytest(player) 
  givePlayerMoney ( player, money [ 6 ] ) 
  end 
  addCommandHandler("on",moneytest) 

Link to comment

You don't need to make table elements to be tables as well, since they do contain only one value. So it'd be better if you make your 'money' table look like:

local money = { 
  [ 1 ] = math.random( 150, 400 ), 
  [ 2 ] = math.random( 400, 600 ), 
  [ 3 ] = math.random( 600, 800 ), 
  [ 4 ] = math.random( 800, 1000 ), 
  [ 5 ] = math.random( 800, 1000 ), 
  [ 6 ] = math.random( 800, 1000 ), 
} 

And it will work, since your function is retrieving the value of the 6th element in the table, which will contain some random number.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...