Scripts / Money_system Script error

Author
Message
Hasevergaming
9
Years of Service
User Offline
Joined: 8th Nov 2015
Location:
Posted: 11th Nov 2015 08:24
"error running function: scriptbank\acid\money_system.lua:96: attempt to index global 'weapon_cost' (a nil value)"
Can anyone please explain what this is and how to fix it?
Thanks

~ Hasevergaming
PM
hiredgunz48
9
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 13th Nov 2015 02:21
Is the money_system.lua script error from one of the quest bunch of scripts? Or a different thing?
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
Hasevergaming
9
Years of Service
User Offline
Joined: 8th Nov 2015
Location:
Posted: 15th Nov 2015 06:27
nah, its a different thing, its just when I try to use the money system to buy weapons
PM
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 16th Nov 2015 09:21 Edited at: 16th Nov 2015 09:53
That's not my script nor have I seen the code myself, but there are a couple of universal things you could try.

1. First thing you should try is to read all the instructions about the script again. There might be some dependency between the money_system.lua and some other scripts that you have missed. Or some tweaking you need to do to the entity in the GameGuru editor. Read the instructions carefully. Have you checked Always Active ('Yes') and Static Mode ('No')?

2. Money System is Acid's script so you should maybe contact Acid himself for support. If he isn't currently active in the forum, try to PM him.

If and only if you can't establish contact with Acid, you can probably try to diagnose the problem yourself. Be aware that this might actually make things worse so before doing anything, repeat step 1. After doing that and before doing anything else take a backup copy of the original script in case you screw something up. Now there are 2 thing I would try if I were you: Try to define weapon_cost as a variable in init function and see what happens. Another thing is to try what happens if you change the reference to weapon_cost in line 96 from variable to table.

If weapon_cost is defined as a table but called as a variable (or vice versa), you get the error.

Defining a variable:
Defining a table:
Calling a variable:
Calling a table:

Edit: I'm almost 100 % sure that there isn't any error in the script, since the script has been there for a long time and it has worked well with other users. So I'll kindly point you to step 1. The instructions can be found here:

https://en.tgcstore.net/product/22987
hiredgunz48
9
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 16th Nov 2015 17:37
Moshroom gave the best advice and since I also don't have the same script as you, PM'ing Acid is the best way to go..

best,

jan
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
Hasevergaming
9
Years of Service
User Offline
Joined: 8th Nov 2015
Location:
Posted: 17th Nov 2015 09:14
ok thanks guys! really appreciate the help
PM

Login to post a reply

Server time is: 2024-12-22 06:45:20
Your offset time is: 2024-12-22 06:45:20