English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 217 218 219 ... 338 339 Next To the start
06.07.10 05:51:27 pm
Up
Refresh
User
Offline Off
okay but then how? I looked over the list and I didnt found it
06.07.10 06:43:26 pm
Up
Homer
User
Offline Off
Code:
1
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

I don't know, that might work.
I detest that man who hides one thing in the depths of his heart, and speaks for another.
06.07.10 06:46:42 pm
Up
Refresh
User
Offline Off
dont work
06.07.10 07:56:15 pm
Up
RyceR
User
Offline Off
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
06.07.10 09:57:00 pm
Up
Snake_Eater
User
Offline Off
Levic has written:
dont work


this will work

Code:
1
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
[Death Note]
06.07.10 10:01:45 pm
Up
Starkkz
Moderator
Offline Off
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:
1
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
lol
07.07.10 05:02:00 pm
Up
Homer
User
Offline Off
Lol, Levic I tried it to make sure, works perfectly, except I didn't know if you wanted the return so just add return 1 and then it works without showing !mypos
Code:
1
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
I detest that man who hides one thing in the depths of his heart, and speaks for another.
07.07.10 09:41:03 pm
Up
Refresh
User
Offline Off
done. thanks
08.07.10 12:45:19 pm
Up
Icarus
COMMUNITY BANNED
Offline Off
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


h i wona learn something about lua can you please say me the basics? thank you!
08.07.10 05:58:40 pm
Up
Homer
User
Offline Off
You just quoted your answeR?
I detest that man who hides one thing in the depths of his heart, and speaks for another.
09.07.10 05:20:49 pm
Up
Rainoth
Moderator
Offline Off
I would like to get such a script...

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...
09.07.10 05:22:16 pm
Up
DRoNe
User
Offline Off
Hey guyz i need help,
if i trigger some things randomly, i want trigger them back...
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
09.07.10 05:32:33 pm
Up
Snake_Eater
User
Offline Off
Hi all can any body show me how to write this symbol??

©

I have copied it out of a other text.
But i need it for colours in lua scripting.
Help pls
[Death Note]
09.07.10 05:38:59 pm
Up
Cure Pikachu
User
Offline Off
Let me re-call...
Alt + 0169 (On your Numpad, turn on NumLock if needed, and please include the zero )
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
09.07.10 06:10:13 pm
Up
mafia_man
User
Offline Off
batlaizys what do you mean ?

you want to hide a wall ?
09.07.10 06:24:26 pm
Up
Snake_Eater
User
Offline Off
TY PIKACHU
[Death Note]
09.07.10 06:54:31 pm
Up
mafia_man
User
Offline Off
Some time ago i see a man who want to create a parkour mod it's possible to make very easy.

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
09.07.10 07:03:53 pm
Up
Snake_Eater
User
Offline Off
@PIKACHU

HOW YOU KNOW THAT.IS ANYWHERE A LIST WITH ALL
SYMBOLS???
[Death Note]
09.07.10 07:23:32 pm
Up
mafia_man
User
Offline Off
Yes it is in Start/Programs/Accesories/System Tools/Symbol Table.ink

09.07.10 07:41:46 pm
Up
Snake_Eater
User
Offline Off
THX
[Death Note]
To the start Previous 1 2 ... 217 218 219 ... 338 339 Next To the start