Forum

> > CS2D > Scripts > Money script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Money script

2 replies
To the start Previous 1 Next To the start

old Money script

Gorillaz BR
User Off Offline

Quote
Hi,i'm new to lua,i'm reading some tutorials,then i make this little script:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","txt")

money=0

function txt(player,text)
if (text=="!allowance") then
	money=..money+10
end
end

function txt(player,text)
if(text=="!balance") then
msg("your money balance:"..money" dollars")
end
end

but,when i say "!allowance" i have this error:

1
unexpected symbol near '..'

some help?

old Re: Money script

kalis
User Off Offline

Quote
try :
1
2
3
4
5
6
7
8
9
10
money=0
addhook("say","txt")
function txt(id,text)
if (text=="!allowance") then
     money=money+10
end
if(text=="!balance") then
msg("your money balance:"..money.." dollars")
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview