Forum
CS2D Scripts Lua Scripts/Questions/Help1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook("say","myposfind") function myposfind(id, txt) if player(id,"health") > 0 then 	if txt == "!mypos" then 	msg2(id, "Your Position X Pixels: "..player(id,"x")) 	msg2(id, "Your Position Y Pixels: "..player(id,"y")) 	msg2(id, "Your Position X Tiles: "..player(id,"tilex")) 	msg2(id, "Your Position Y Tiles: "..player(id,"tiley")) 	end end end
use it
Levic has written
dont work
this will work
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook ("say","text") function text(p,t) if t=="!mypos" then parse ("sv_msg2 "..p.." Your position is Tile X ="..player(p,"tilex").." Tile Y ="..player(p,"tiley").."") parse ("sv_msg2 "..p.." Your position is Pixel X ="..player(p,"x").." Pixel Y ="..player(p,"y").."") end end
edited 1×, last 07.07.10 07:34:15 pm
texnonikWP has written
Why dont working ?
[ code ]addhook("startround","sample.ut.startround")
function sample.ut.startround()
local game=math.random(1,4)
if game==1 then
parse("trigger a1")
sample.trigger="a1"
elseif game==2 then
parse("trigger a2")
sample.trigger="a2"
elseif game==3 then
parse("trigger a3")
sample.trigger="a3"
elseif game==4 then
parse("trigger a4")
sample.trigger="a4"
end
end
end[ /code ]
[ code ]addhook("startround","sample.ut.startround")
function sample.ut.startround()
local game=math.random(1,4)
if game==1 then
parse("trigger a1")
sample.trigger="a1"
elseif game==2 then
parse("trigger a2")
sample.trigger="a2"
elseif game==3 then
parse("trigger a3")
sample.trigger="a3"
elseif game==4 then
parse("trigger a4")
sample.trigger="a4"
end
end
end[ /code ]
1
2
3
4
5
6
2
3
4
5
6
addhook("startround","sample.startround") function sample.startround() 	local game = math.random(1,4) 	parse("trigger a"..game) 	sample.trigger = "a"..game end
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("say","myposfind") function myposfind(id, txt) if player(id,"health") > 0 then if txt == "!mypos" then msg2(id, "Your Position X Pixels: "..player(id,"x")) msg2(id, "Your Position Y Pixels: "..player(id,"y")) msg2(id, "Your Position X Tiles: "..player(id,"tilex")) msg2(id, "Your Position Y Tiles: "..player(id,"tiley")) 	return 1 end end end
DC has written
Please use this thread to post your CS2D Lua Scripts or to to ask questions about Lua!
Moreover you can upload finished and good scripts there:
Lua Scripts file section
I recommend to use the [ code ] your script [ /code ] tags (without the spaces) to post your scripts.
NEW ALTERNATIVE: CS2D.org
Lee established a page for your Lua questions! Visit www.CS2D.org
Moreover you can upload finished and good scripts there:
Lua Scripts file section
I recommend to use the [ code ] your script [ /code ] tags (without the spaces) to post your scripts.
NEW ALTERNATIVE: CS2D.org
Lee established a page for your Lua questions! Visit www.CS2D.org
h i wona learn something about lua can you please say me the basics? thank you!
when u say !hide a wall 3 or wall 2 etc. appears.
Its good for construction mod when u can hide between buildings
I managed to make 1 ,but when i say it a supply appears on ALL of players... Idk how to make this code thingy...
i would write it...
parse("mp_building_health supply 10000")
addhook("say","build")
function build(id,txt)
for id=1,32 do
if (txt=="!hide") then
parse("spawnobject 9 "..player(id,"tilex").." "..player(id,"tiley").." 1 1 1 1")
end
end
end
plz help...
if i trigger some things randomly, i want trigger them back...
©
I have copied it out of a other text.
But i need it for colours in lua scripting.
Help pls
Alt + 0169 (On your Numpad, turn on NumLock if needed, and please include the zero )
you want to hide a wall ?
Define a one variable isjump
If player click F2 and if he don't jumping now then he jump
And then addtimer to set variable isjump to 0 when he end jumping
if isjump is 1 then use sin and cos and rad to make player move with his direction
And then on map add a tile and if player stay on it and isjump is 0 then he got killed and spawned
HOW YOU KNOW THAT.IS ANYWHERE A LIST WITH ALL
SYMBOLS???