Forum

> > CS2D > Scripts > lottery
Forums overviewCS2D overview Scripts overviewLog in to reply

English lottery

5 replies
To the start Previous 1 Next To the start

old lottery

cartel
User Off Offline

Quote
hi, I'm looking for script, write "!lottery" and get weapons, armor, money, or money is taken.

someone write me a script?

old Re: lottery

Avo
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
lott = lott or {}
lott.randoms = {1,2,3}
lott.cost = 5000

addhook("say", "lott.OnSay")
lott.OnSay = function(id, txt)
	if txt == "@lottery" and player(id, "health") > 0 then
		if player(id, "money") >= lott.cost then
			parse("setmoney "..id.." "..(player(id, "money") - lott.cost))
			local RAND = lott.randoms[math.random(1, #lott.randoms)]
			if type(RAND) == "number" or type(RAND) == "string" then
				parse("equip "..id.." "..RAND)
			elseif type(RAND) == "function" then
				RAND(id)
			else
				msg2(id, string.char(169).."255000000Bad luck!@C")
			end			
		else
			msg2(id, string.char(169).."255000000You don't have enough money! @C")
		end
	end
end
lott.randoms - table that holds items in lottery or functions executed with player's ID parameter. If you don't get it, use just numbers.

Oh, how does it works? Say "@lottery"!

old Re: lottery

Thug Life
User Off Offline

Quote
Is a script made by Head_Hunter_Tr. I have that script but give me your email to send it to you. If you have problems with him plz PM me

old Re: lottery

cartel
User Off Offline

Quote
user Avo has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
lott = lott or {}
lott.randoms = {1,2,3}
lott.cost = 5000

addhook("say", "lott.OnSay")
lott.OnSay = function(id, txt)
	if txt == "@lottery" and player(id, "health") > 0 then
		if player(id, "money") >= lott.cost then
			parse("setmoney "..id.." "..(player(id, "money") - lott.cost))
			local RAND = lott.randoms[math.random(1, #lott.randoms)]
			if type(RAND) == "number" or type(RAND) == "string" then
				parse("equip "..id.." "..RAND)
			elseif type(RAND) == "function" then
				RAND(id)
			else
				msg2(id, string.char(169).."255000000Bad luck!@C")
			end			
		else
			msg2(id, string.char(169).."255000000You don't have enough money! @C")
		end
	end
end
lott.randoms - table that holds items in lottery or functions executed with player's ID parameter. If you don't get it, use just numbers.

Oh, how does it works? Say "@lottery"!


thank you!

command @lottery can use forever, what I write so I can use the command @lottery once per round?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview