Forum

> > CS2D > Scripts > Money from objects/NPC's
Forums overviewCS2D overview Scripts overviewLog in to reply

English Money from objects/NPC's

10 replies
To the start Previous 1 Next To the start

old Money from objects/NPC's

Alistaire
User Off Offline

Quote
Spoiler >


I've tried to add;

1
parse('setmoney '..id..' '..player(id, 'money')+10)

But then the console says "player(id)" is a nil value.
I guess it's because collectables_break_hook has no (id) behind it, but how do I fix it?

----

Ftr;

- The script(s) has/ve to give EVERY player +10 money when someone breaks / kills something.

Thus;

- I need 2 scripts; 1 for NPC's and 1 for breakables.

old Re: Money from objects/NPC's

DannyDeth
User Off Offline

Quote
That error is because factis is completely nuts, setmoney is nil, so it's "false" in Lua's eyes. Hnce arithmetic on a bool.

old Re: Money from objects/NPC's

Deleted User

Quote
user DannyDeth has written
That error is because factis is completely nuts, setmoney is nil, so it's "false" in Lua's eyes. Hnce arithmetic on a bool.


Means setmoney is variable?
OH I GET IT.

try to make:
1
2
3
for n, w in ipairs(player(0, 'tableliving') do
	parse('setmoney '..w..' '..player(w, 'money')+10)
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview