Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2245 246 247338 339 Next To the start

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
iDios has written
*batlaizys, I want one script Angel for all, and one script Police for only CT ...
Thanks you !


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
addhook("say","whatever")
function whatever(id,t)
	if t=="!angel" then
		if (player(id,"health")>0) then
			freeimage(id)
			image("gfx/flare2.bmp",1,1,200+id)
			msg2(id,"©000255000You now have an angel sprite")
			return 1
		else
			msg2(id,"©255000000You are dead")
			return 1
end
	elseif t=="!remove" then
		if (player(id,"health")>0) then
			freeimage(id)
			msg2(id,"©255000000Youve removed your sprite")
			return 1
		else
			msg2(id,"©255000000You are dead")
			return 1
end
	elseif t=="!car" then
		if (player(id,"team") == 2) then
			freeimage(id)
			image("gfx/flare2.bmp",1,1,200+id)
			msg2(id,"©000255000You now have an car sprite")
			return 1
		else
			msg2(id,"©255000000You cant get this sprite, You need to be in CT")
			return 1 end
		end
	end

old Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Quote
I have a question...
How can i make people cant use server action (F2 , F3 , F4) if they are dead !? Please help i need this script very quick for my server


and 1 more....
when you say !party "id" then when you hit player have the "id", it has no damage and when you say !unparty "id" and when you hit them, it has damage again.

Thank you !
edited 2×, last 31.08.10 05:18:32 am

old Re: Lua Scripts/Questions/Help

Blacko
User Off Offline

Quote
Ok thanks HaRe, they works, but a problem, they cant be removed ... And the car dont work ... Please help
edited 3×, last 31.08.10 02:24:21 pm

old Re: Lua Scripts/Questions/Help

kalis
User Off Offline

Quote
help me if license==true
help me script save @ @
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local usgn, i = player(id,"usgn")
     if (usgn > 0) then
          local f = (io.open('sys/lua/license/'..player(id,"usgn")..'.txt','r'))
          if f then
               msg2(id,'Loading...^^!@C')
               for line in f:lines() do
                    i = 1
                    if (i == 1) then
                         rp_license[id] = value(line)
                    else
                         break
                    end
               end
               f:close()
               i = 1
          else
               msg2(id,'We are sorry, but failed to load save!@C')
          end
     else
          msg2(id,'Please Check Your U.S.G.N. Account Settings!@C')
     end
end
end
add+
1
2
3
4
5
6
7
8
9
function Array(size,value) 
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end

rp_license = Array(32,false)

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
Hello i need 2 scripts if i attack with claw team friend i got bandage
2 script
if i attack with machete team friend i got secondary ammo and priamary fast plz

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
@Soja1997
I'll try my best, hope it works... (Fix needed)
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("hit","healammo")
function healammo(victim,source,weapon)
	if player(victim,"team") == player(source,"team") then
		if weapon == 69 then
			parse("spawnitem 65 "..player(source,"tilex").." "..player(source,"tiley"))
			return 1
		elseif weapon == 78 then
			parse("spawnitem 61 "..player(source,"tilex").." "..player(source,"tiley"))
			parse("spawnitem 62 "..player(source,"tilex").." "..player(source,"tiley"))
			return 1
		end
	end
end
KenVo has written
I have a question...
How can i make people cant use server action (F2 , F3 , F4) if they are dead !? Please help i need this script very quick for my server

1
2
3
4
5
6
addhook("serveraction","stop")
function stop(id,action)
	if player(id,"health") > 0 then
		-- Your command here
	end
end

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
can you help me ? i need 2script for tt and ct
CT 8 classes and TT 8 classes but TT classes dont work

TT
Spoiler >


CT
Spoiler >


and thanks for all

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
Script is messed up, but I did it, I guess...

Terrorist
More >

CTs
More >

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
tt class dont work and ct work i have mean
dofile("sys/lua/axis.lua") < TT
dofile("sys/lua/allies.lua") <CT
dofile("sys/lua/alxis.lua") <SCript Heal,ammo
@edit
Ct May have some class
and tt May have some class

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
@Soja1997 hmm.... you must change all hooks for terro and CT like:
for addhook("spawn","sample.classes.spawn") write addhook("spawn","sample.classes.CTspawn")

it can help

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
yes i know but it dont work
@edit
tt class dont work and ct work i have mean
dofile("sys/lua/axis.lua") < TT
dofile("sys/lua/allies.lua") <CT
dofile("sys/lua/alxis.lua") <SCript Heal,ammo
@edit
Ct May have some class
and tt May have some class
i need unlimited gutbombs and snowballs scripts
edited 1×, last 31.08.10 04:11:11 pm

old Re: Lua Scripts/Questions/Help

texnonik
User Off Offline

Quote
Help need lua

all can chose only CT every go CT round dont strat ramdom player goes 1 only to T .when ending round then again ramdom go T .

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
why it dont work?:
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
function low_hp_text()
	for id = 1, 32 do
		parse('hudtxt2 '..id..' 1 "©255000000Health: "..player(id,"health").." " 13 200')
		parse('hudtxt2 '..id..' 2 "Low " 13 212')
	end
end

function good_hp_text()
	for id = 1, 32 do
		parse('hudtxt2 '..id..' 1 "©255200000Health: "..player(id,"health").." " 13 200')
		parse('hudtxt2 '..id..' 2 "©255200000Good " 13 212')
	end
end

function very_good_hp_text()
	for id = 1, 32 do
		parse('hudtxt2 '..id..' 1 "©000255000Health: "..player(id,"health").." " 13 200')
		parse('hudtxt2 '..id..' 2 "©000255000Very good " 13 212')
	end
end

function super_hp_text()
	for id = 1, 32 do
		parse('hudtxt2 '..id..' 1 "©000170000Health: "..player(id,"health").." " 13 200')
		parse('hudtxt2 '..id..' 2 "©000170000Super! " 13 212')
	end
end

function best_hp_text()
	for id = 1, 32 do
		parse('hudtxt2 '..id..' 1 "©000200000Health: "..player(id,"health").." " 13 200')
		parse('hudtxt2 '..id..' 2 "©000200000The best! " 13 212')
	end
end

addhook("ms100","hp_counter")
function hp_counter()
	for id = 1, 32 do
		if player(id,"health") < 26 then
			low_hp_text(id)
		elseif player(id,"health") < 71 then
			good_hp_text(id)
		elseif player(id,"health") < 101 then
			very_good_hp_text(id)
		elseif player(id,"health") < 201 then
			super_hp_text(id)
		else
			best_hp_text(id)
		end
	end
end

old Re: Lua Scripts/Questions/Help

KenVo
User Off Offline

Quote
Pikachu xD has written
KenVo has written
I have a question...
How can i make people cant use server action (F2 , F3 , F4) if they are dead !? Please help i need this script very quick for my server

1
2
3
4
5
6
addhook("serveraction","stop")
function stop(id,action)
	if player(id,"health") > 0 then
		-- Your command here
	end
end


This is tibia script and i can still use my inventory and equipment when i am dead
Spoiler >

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
why it dont work?:
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
function low_hp_text()
     for id = 1, 32 do
          parse('hudtxt2 '..id..' 1 "©255000000Health: "..player(id,"health").." " 13 200')
          parse('hudtxt2 '..id..' 2 "Low " 13 212')
     end
end

function good_hp_text()
     for id = 1, 32 do
          parse('hudtxt2 '..id..' 1 "©255200000Health: "..player(id,"health").." " 13 200')
          parse('hudtxt2 '..id..' 2 "©255200000Good " 13 212')
     end
end

function very_good_hp_text()
     for id = 1, 32 do
          parse('hudtxt2 '..id..' 1 "©000255000Health: "..player(id,"health").." " 13 200')
          parse('hudtxt2 '..id..' 2 "©000255000Very good " 13 212')
     end
end

function super_hp_text()
     for id = 1, 32 do
          parse('hudtxt2 '..id..' 1 "©000170000Health: "..player(id,"health").." " 13 200')
          parse('hudtxt2 '..id..' 2 "©000170000Super! " 13 212')
     end
end

function best_hp_text()
     for id = 1, 32 do
          parse('hudtxt2 '..id..' 1 "©000200000Health: "..player(id,"health").." " 13 200')
          parse('hudtxt2 '..id..' 2 "©000200000The best! " 13 212')
     end
end

addhook("ms100","hp_counter")
function hp_counter()
     for id = 1, 32 do
          if player(id,"health") < 26 then
               low_hp_text(id)
          elseif player(id,"health") < 71 then
               good_hp_text(id)
          elseif player(id,"health") < 101 then
               very_good_hp_text(id)
          elseif player(id,"health") < 201 then
               super_hp_text(id)
          else
               best_hp_text(id)
          end
     end
end
PLZ help!

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Soja1997 has written
some one can help me?... i dont understand lua

YES, I think we all noticed that, so I've added some links to useful tutorials in my signature
|
v
To the start Previous 1 2245 246 247338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview