Forum

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

English Gun script

10 replies
To the start Previous 1 Next To the start

old Gun script

Caelenn
User Off Offline

Quote
Hi
I need help with a (simple) script.
How to make that:
When i say "!mgun" i get m249, but i lost 5000$.
Pls help.
Spoiler >

old Re: Gun script

RAVENOUS
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("say","items")
function items(p,txt)
	if (txt=="!lm") then
		if player(p,"money)>=5000 then
			parse("equip "..p.." 87")
		end
	end
end
edited 1×, last 29.01.11 05:55:15 pm

old Re: Gun script

Anders4000
User Off Offline

Quote
Quote
1
2
3
if player(p,"money)=<5000 then
               parse("equip "..p.." 87")
end


It shall be "if player(p,"money)=>5000"
His has to have 5000 or more...

And you gotta take 5000 money from him, after the equip...

old Re: Gun script

KimKat
GAME BANNED Off Offline

Quote
Then this would work I assume.
1
2
3
4
5
6
7
8
9
10
addhook("say","items")
function items(p,txt)
	if (txt=="!buy item 87") then
	if player(p,"money")>=5000 then
		player(p,"money")-5000
		parse("equip "..p.." 87")
	else
		msg2(p,[[©255075075You don't have enough money to purchase this item.@C]])
	end
end
To me it's logical, but if it doesn't work then it's my bad.
edited 1×, last 29.01.11 06:28:22 pm

old Re: Gun script

RAVENOUS
BANNED Off Offline

Quote
Anders4000 has written
It shall be "if player(p,"money)=>5000"

in fact it should be
1
>=
I was in rush hour. Edited.

And you forgot a " in your scriptpart.

old Re: Gun script

TimeQuesT
User Off Offline

Quote
1
2
3
4
5
6
if (txt=="aa") then
if(player(p,"money")>=5000) then
parse ("equip "..p.." idk weap id ;)")
parse ("setmoney "..p.." "..player(p,"money")-5000)
end
end
insert this --> into the "say" hook.

old Re: Gun script

Homam
User Off Offline

Quote
@KimKat It works good.
but my question
can you make it only for some usgn's?
more than one
thx,

old Re: Gun script

KimKat
GAME BANNED Off Offline

Quote
This Lua script might work then.
Spoiler >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview