But i want it with Timer function. I am not really good at your type and i know little bit about timers so it will be easier for me to understand...
Forum
Scripts
Lua Scripts/Questions/HelpBut i want it with Timer function. I am not really good at your type and i know little bit about timers so it will be easier for me to understand...
1 End round - music
2 End round - second music, but 1 music is steel playing...
i want:
1 End round - 1 music
2 End round - second music and 1 music is stopped.
1
2
3
4
5
6
7
2
3
4
5
6
7
function Timer(time) 	finish-time = os.clock + time 	while(os.clock < finish-time) 		-- Wait until it finishes 	end 	return 1; end
You would use it like this:
1
2
3
4
5
6
7
2
3
4
5
6
7
function speed-potion(id)
	parse("speedmod "..id.." 50")
	while(Timer(5) < 1)
		-- Wait until timer is finished
	end
	parse("speedmod "..id.." 0")
end
@Yamato: Still busy I will probably finish soon
BureX has written
Can i make "ai_goto" more of them ? like every random bot goes to random "ai_goto" and starts to attack when destination is reached ?
1
2
3
2
3
addhook("ai_goto","zmgo")
function zmgo(id,32,64)
end
Can i make "ai_goto" more of them ? like every random bot goes to random "ai_goto" and starts to attack when destination is reached ?
@DannyDeth somebody gotta explain me this "Seriously"
P.S. i am not in the mood (i waited to get on MY own computer for weeks. I couldnt get on my pc cuz of an F's)
edited 1×, last 23.12.10 01:46:43 pm
Just:
1
ai_goto(BOT ID,X,Y)
X = Tile X or X, idk
Y = Tile Y or Y, idk
Stop being a wimp and actually do something! I am not going to spend my time checking shit you could of done yourself! So stop asking us about it an try it out, live dangerous!
@DannyDeth maybe cuz i cant turn on cs2d ?? IS THIS THE F***ING PROBLEM YOU ARE MAD OF ?
1
2
3
4
5
6
7
2
3
4
5
6
7
function ai_gotot(id,x,y) 	if player(id,"bot") then 		if player(id,"team") == 1 then 			ai_goto(id,x,y) 		end 	end end
now use
1
ai_gotot(id,x,y)
BureX has written
@maybe cuz i cant turn on cs2d ?? IS THIS THE F***ING PROBLEM YOU ARE MAD OF ?
Then why the heck you're asking?
Seriously, recent questions are way too simple.
I doubt that people under 13 would ask such a things.
The questions thread has become a request one.
edited 1×, last 23.12.10 02:20:00 pm
P.S.
im 14 (23.4.1996) nvm lets just get off a this
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
function initArray(m)
	local array = {}
	for id = 1, m do
		array[id]=0
	end
	return array
end
lvl=initArray(32)
xp=initArray(32)
xpm=initArray(32)
mp=initArray(32)
mpm=initArray(32)
hp=initArray(32)
hpm=initArray(32)
addhook([[ms100]],[[lol_huds]])
function lol_huds(id)
	for id=1,32 do
		parse('hudtxt2 '..id..' 1 "©255000000Health "..hp[id].."/"..hpm[id].."" 360 430')
	end
end
And screen:

Dont show hp/hpmax and bad position...
In console is one error (spam):

Can anyone help?
1
addhook([[ms100]],[[lol_huds]])
So here is an un-tested version of your code that should hopefully fix the problem:
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
function initArray(m)
local array = {}
for id = 1, m do
array[id]=0
end
return array
end
lvl=initArray(32)
xp=initArray(32)
xpm=initArray(32)
mp=initArray(32)
mpm=initArray(32)
hp=initArray(32)
hpm=initArray(32)
addhook("ms100","lol_huds")
function lol_huds()
for i=1,32,1 do
parse('hudtxt2 '..id..' 1 "©255000000Health "..hp[id].."/"..hpm[id].."" 360 430')
end
end
However I cannot say it will work asi i do not have the full script
Here is full script:
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%% FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function lol_reset(id)
	lvl[id]=1
	xp[id]=0
	xpm[id]=250
	mpm[id]=5
	mp[id]=mpm[id]
	hpm[id]=30
	hp[id]=hpm[id]
end
function lol_icons(id)
	img1=image("gfx/(F)ehuziom Folder Sprite/rpg_mod/Okienko prawo dol.png",0,0,2,id)
	imagepos(img1,610,430,0)
	imagealpha(img1,0.9)
	img2=image("gfx/(F)ehuziom Folder Sprite/rpg_mod/Okienko prawo gora.png",0,0,2,id)
	imagepos(img2,582,45,0)
	imagealpha(img2,0.9)
	img3=image("gfx/(F)ehuziom Folder Sprite/rpg_mod/Okienko lewo gora.png",0,0,2,id)
	imagepos(img3,58,45,0)
	imagealpha(img3,0.9)
	img4=image("gfx/(F)ehuziom Folder Sprite/rpg_mod/Okienko lewo dol.png",0,0,2,id)
	imagepos(img4,30,430,0)
	imagealpha(img4,0.9)
	img5=image("gfx/(F)ehuziom Folder Sprite/rpg_mod/pasek hp.png",0,0,2,id)
	imagepos(img5,350,430,0)
	imagealpha(img5,0.9)
	img6=image("gfx/(F)ehuziom Folder Sprite/rpg_mod/pasek mp.png",0,0,2,id)
	imagepos(img6,350,450,0)
	imagealpha(img6,0.9)
end
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%% MAIN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function initArray(m)
	local array = {}
	for id = 1, m do
		array[id]=0
	end
	return array
end
lvl=initArray(32)
xp=initArray(32)
xpm=initArray(32)
mp=initArray(32)
mpm=initArray(32)
hp=initArray(32)
hpm=initArray(32)
for id=1,32 do
	lol_reset(id)
	lol_icons(id)
end
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%% ENGINE %%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
addhook("join","lol_welcome")
function lol_welcome(id)
	lol_reset(id)
	lol_icons(id)
end
addhook("say","lol_text")
function lol_text(id,txt)
	if player(id,"team")<=2 then
		name=player(id,"name")
		msg([[©255255255]]..name..[[(LV.]]..lvl[id]..[[): ]]..txt)
	end
	return 1
end
addhook("ms100","lol_huds")
function lol_huds(id)
	for id=1,32 do
		parse('hudtxt2 '..id..' 1 "©255000000Health "..hp[id].."/"..hpm[id].."" 360 430')
	end
end
Okay i change all and no spam errors in console, but hudtxt dont work
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("ms100","lol_huds")
function lol_huds(id)
	for id = 1,32 do
		if player(id,"exists") then
			parse('hudtxt2 '..id..' 1 "©255000000Health '..hp[id]..'/'..hpm[id]..'" 360 430 0')
		end
	end
end
Edit:
@DannyDeth
You can use [[]], too.
These are all strings:
1
2
3
2
3
lol = 'lol' lol = "lol" lol = [[lol]]
edited 1×, last 23.12.10 04:08:41 pm
1
2
3
4
5
6
2
3
4
5
6
addhook("ms100","get_hp")
function get_hp()
	for i=1,32,1 do
		hp[i]=player(i,"health")
	end
end
Here is a proper correctio n of the code, it was because of confused " and ' thingies.
1
2
3
4
5
6
2
3
4
5
6
addhook("ms100","lol_huds")
function lol_huds()
for i=1,32,1 do
parse('hudtxt2 '..id..' 1 "©255000000Health '..hp[i]..'/'..hpm[i]..'" 360 430')
end
end
The only thing it can't display is nil values.
But if you use nil as string(txt = "nil") it works too.
Lua Scripts/Questions/Help


Offline