Forum

> > CS2D > Scripts > buy exp script
Forums overviewCS2D overview Scripts overviewLog in to reply

English buy exp script

4 replies
To the start Previous 1 Next To the start

old buy exp script

berserk
User Off Offline

Quote
help me to make script, where said rune, opening menu and select buy exp(10000$) and get random exp. Please HELP!!! Sorry for my bad English)

old Re: buy exp script

LuaNewBie
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
23
24
25
26
27
28
29
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

exps = initArray(32)

addhook("say","say")
function say(id,text)
if text == "!rune" then
	menu(id,"Rune,Buy EXP|10000$")
	return 1
	end
end

addhook("menu","menu")
function menu(id,title,button)
if title == "Rune" then
	if button == 1 then
		if (player(id,"money")>=10000) then
			parse("setmoney "..id.." "..player(id, "money") - 10000)
			exps[id]=exps[id]+math.random(1,99999)
			end
		end
	end
end

Like this ? , Untest and unoptimize

Edit 1 : Sorry , i didn't notice that checker
edited 1×, last 17.08.12 07:26:00 pm

old Re: buy exp script

Suprise
BANNED Off Offline

Quote
1
if (player(id,"money")>=10000) then

Add this after the "if button == 1 then"

old Re: buy exp script

RedizGaming
GAME BANNED 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
23
24
25
26
27
28
29
function Array(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

exp = Array(32,0)

addhook("serveraction","a")
function a(id,action)
	if action==1 then
		menu(id,"Buy Exp,5 XP|1K,205 EXP|5K")
	end
end

addhook("menu","b")
function b(id,title,button)
if title=="Buy Exp" then
if button==1 and player(id,"money")==1000 then
parse('setmoney '..id..' '..player(id,'money')-1000)
exp[id]=exp[id]+5
elseif button==2 and player(id,"money")==5000 then
parse('setmoney '..id..' '..player(id,'money')-5000)
exp[id]=exp[id]+205
end
end
end

@user berserk:
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview