I'm looking for a lua script make talking in a radius, like the Tibia script talking idea, with the images popping up above the player! If you have a file like this, or can make one for me, I would be very thankfull.
Forum
CS2D Scripts Lua Scripts/Questions/HelpI'm looking for a lua script make talking in a radius, like the Tibia script talking idea, with the images popping up above the player! If you have a file like this, or can make one for me, I would be very thankfull.
Yasday has written
I have a question:
Is it possible to edit the name of an entity with lua?
Is it possible to edit the name of an entity with lua?
ye i think so
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("startround","rename") function rename() local x,y = X,Y -- change X,Y to your x and y 	if (entity(x,y,"exists")) then 		if (entity(x,y,"name") == "NAME") then 			local Namehere = (entity(x,y,"name") == "NAME") 		end 	end end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("say","shop") function shop(id,txt) if txt == "!shop" then parse("sv_msg2 "..id.." ©255000000WELCOME TO BATLAIZYS SHOP") parse("sv_msg2 "..id.." Heal ! (5 Credits) ") parse("sv_msg2 "..id.." More Health ! (50 Credits) ") parse("sv_msg2 "..id.." Book for Beginers ! (50 Credits) ") parse("sv_msg2 "..id.." Book for Players ! (100 Credits)") parse("sv_msg2 "..id.." Book for Skillerz ! (200 Credits)") parse("sv_msg2 "..id.." Book for Masters ! (500 Credits) ") parse("sv_msg2 "..id.." ©255000000WELCOME TO BATLAIZYS SHOP") 	return 1 end end
Thank you for your help
is this possible?
Unknown Killer has written
how do i use map command in lua script i mean if i have object name "blabla" how do i use this object in lua
is this possible?
is this possible?
if you want to disable a trigger use then do it like this:
1
2
3
4
2
3
4
addhook([[startround]],[[startbutton]]) function startbutton(id) 	parse("trigger NAME_OF_BUTTON_OR_STH_ELSE") end
batlaizys has written
@Tajifun I DID use one say hook cant you see ?
check your script if there is any other say remove it and will work, this happened to me also but i put the codes in 1 say and works fine
Edit:
@yasday
the codes works fine but how do i make if player at "object name" then display a msg?
Flacko has written
Use level[p] instead of level[id]
flaco thanks i love you
Anyway how do i make other things in 1 say hook ?
example
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
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
addhook("say","shop") function shop(id,txt) if txt == "!shop" then parse("sv_msg2 "..id.." ©255000000WELCOME TO BATLAIZYS SHOP") parse("sv_msg2 "..id.." Heal ! (5 Credits) ") parse("sv_msg2 "..id.." More Health ! (20 Credits) ") parse("sv_msg2 "..id.." Book for Beginers ! (50 Credits) ") parse("sv_msg2 "..id.." Book for Players ! (100 Credits)") parse("sv_msg2 "..id.." Book for Skillerz ! (200 Credits)") parse("sv_msg2 "..id.." Book for Masters ! (500 Credits) ") parse("sv_msg2 "..id.." ©255000000WELCOME TO BATLAIZYS SHOP") 	return 1 end end addhook("say","resetsay") function resetsay(id,txt) if txt == "!reset" then parse("sv_msg2 "..id.." You have reset your stats !") level[id]=0 exp[id]=0 	return 1 end end
should i do it
1
2
3
4
5
2
3
4
5
if txt == "haha!" then blabla... elseif txt == "lolz" then blabla2.
try this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("say","blabla") function blabla(id,txt) if txt == "!shop" then parse("sv_msg2 "..id.." ©255000000WELCOME TO BATLAIZYS SHOP") parse("sv_msg2 "..id.." Heal ! (5 Credits) ") parse("sv_msg2 "..id.." More Health ! (20 Credits) ") parse("sv_msg2 "..id.." Book for Beginers ! (50 Credits) ") parse("sv_msg2 "..id.." Book for Players ! (100 Credits)") parse("sv_msg2 "..id.." Book for Skillerz ! (200 Credits)") parse("sv_msg2 "..id.." Book for Masters ! (500 Credits) ") parse("sv_msg2 "..id.." ©255000000WELCOME TO BATLAIZYS SHOP") return 1 	 elseif txt == "!reset" then parse("sv_msg2 "..id.." You have reset your stats !") level[id]=0 exp[id]=0 return 1 end end
btw: Yes I CAN'T SEE!
I'm good writing in LUA, made carmod with my friend and...
i dont still understand how knockback works. So if someone can code one for me? Example. 1 hit = 1 step back, 2 hit = 2 step back...
I'll will be very happy, and giving Admin to my Carmod server.
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
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
recoil_factor = 3 addhook('hit','knockback') function knockback(id,source,weapon) local killer_x = player(source,'x') local killer_y = player(source,'y') local victim_x = player(id,'x') local victim_y = player(id,'y') local recoil = itemtype(weapon,'recoil') * recoil_factor 	if player(source,'exists') then 		if killer_x > victim_x then 			if tile(player(id,'tilex') - 1,player(id,'tiley'),'walkable') then 				parse('setpos '..id..' '..(player(id,'x') - recoil)..' '..player(id,'y')) 			end 		end 		if killer_x < victim_x then 			if tile(player(id,'tilex') + 1,player(id,'tiley'),'walkable') then 				parse('setpos '..id..' '..(player(id,'x') + recoil)..' '..player(id,'y')) 			end 		end 		if killer_y > victim_y then 			if tile(player(id,'tilex'),player(id,'tiley') - 1,'walkable') then 				parse('setpos '..id..' '..player(id,'x')..' '..(player(id,'y') - recoil)) 			end 		end 		if killer_y < victim_y then 			if tile(player(id,'tilex'),player(id,'tiley') + 1,'walkable') then 				parse('setpos '..id..' '..player(id,'x')..' '..(player(id,'y') + recoil)) 			end 		end	 	end end
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("objectdamage","no_super_supply") function no_super_supply(id,dmg,wpn,object) 	if object == 9 then 		if dmg == 0 then 			return 1 		end 	end end
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("objectdamage","no_super_supply") function no_super_supply(id,dmg,pl) 	if object(id,"type") == 9 then 		if dmg == 0 then 			return 1 		end 	end end
function healgun(id)
if level[id] >= 4 then
local x, y
x = player( id, "x")
y = player( id, "y")
parse('effect "fire" ' ..x.. ' ' ..y.. ' 1 1 0 0 0')
parse("sethealth "..id.." "..(player(id,"health")-7))
end
end
what wrong??
error = level < 4 and if you shot enemy your shots are explosive
normal = level > 4 and if you shot enemy your shots are explosive (i need this)
i need help