here is my first test and it worked.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local img = image("gfx/npc6.png",250,100,2) knt = 0 function small() tween_scale(img,1500,1.0,1.0) end function big() tween_scale(img,1500,5.0,5.0) end addhook("serveraction","ts") function ts(id,act) 	if act == 1 then 		if knt == 0 then 			big() 			knt = 1 		elseif knt == 1 then 			small() 			knt = 0 		end 	end end
I can control my gfx with f2 but i want to control myself i tried this script but failed
Error is: LUA ERROR: sys/lua/tw.lua:10: bad argument #1 to 'tween_scale' (number expected, got nil)
Line 10: tween_scale(id,1500,5.0,5.0)
Here is the script, please fix it and please tell me my mistake.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
knt = 0 function small(id) tween_scale(id,1500,1.0,1.0) end function big(id) tween_scale(id,1500,5.0,5.0) end addhook("serveraction","ts") function ts(id,act) 	if act == 1 then 		if knt == 0 then 			big(id) 			knt = 1 		elseif knt == 1 then 			small(id) 			knt = 0 		end 	end end
Thanks
edited 3×, last 10.06.13 11:44:16 pm