someone write me a script?
Forum
CS2D Scripts lotterylottery
5 replies 1
someone write me a script?
I am looking for something else
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
Oh, how does it works? Say "@lottery"!
Avo has written 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"!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
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?
1