English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 302 303 304 ... 338 339 Next To the start
07.11.10 01:31:24 pm
Up
TDShuft
User
Offline Off
Joaopcvcastro has written:
Please, what im doing worng? can someone help?
Code:
1
2
3
4
addhook("startround","starting")
function starting(mode)
parse("trigger ENTITY_NAME")
end

I want to every roundstart it will trigger a entity on the map, on ENTITY_NAME i put the name of the entity that i want to trigger and it still dont works, please i need help

well for me its working o.O
Sorry , I can't be Perfect !
07.11.10 03:21:50 pm
Up
Mechanolith
User
Offline Off
Strange... the function starting (MODE) is to change for something?
But i will try it once more
Anyway, thanks for the help
07.11.10 04:28:44 pm
Up
Glix
User
Offline Off
Please can you help me with this

Code:
1
2
3
4
5
6
7
8
addhook("say","tele")
function tele(id,txt)
if txt == "!Vippass" then
parse("sv_msg2 "..id.." You are now on Vip Room")
parse("setpos "..id.." 2694 2118")
parse("equip "..id.." 88, 6")
end
end


What wrong with it
Create free website for your clan! Create server control panel webE --->http://www.000webhost.com/581961.html
07.11.10 07:26:31 pm
Up
Fehu
User
Offline Off
steam-cs2d has written:
Please can you help me with this

Code:
1
2
3
4
5
6
7
8
9
addhook("say","tele")
function tele(id,txt)
     if (txt=="!vippass") then
          parse("sv_msg2 "..id.." You are now on Vip Room")
          parse("setpos "..id.." 2694 2118")
          parse("equip "..id.." 88")
          parse("equip "..id.." 6")
     end
end


What wrong with it

Fixed!
I have problem:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","rpg_chat")
function rpg_chat(id,txt)
     if player(id,"team")==2 then
          parse("msg ©220220220"..player(id,"name").."[WhiteClan]: "..txt)
          return 1
     end
     if player(id,"team")==1 then
          parse("msg ©100100100"..player(id,"name").."[BlackClan]: "..txt)
          return 1
     end
     if player(id,"team")==3 then
          parse("msg "..player(id,"name").."[SPECATE]: "..txt)
          return 1
     end
end

Why return 1 dont work ???
IMG:http://www.flashflashrevolution.com/profile/newsiggy/Fehu/stardust/0/0-1-2-3-4-5.png
07.11.10 07:33:38 pm
Up
Fasttt
User
Offline Off
@Fehusiom

it may don't work because you use more than 1 "say" hook.
anyway, your code is absolutely right, and return 1 should be working
07.11.10 08:04:45 pm
Up
TDShuft
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
addhook("say","rpg_chat")
function rpg_chat(id,txt)
     if player(id,"team")==2 then
          parse("msg ©220220220"..player(id,"name").."[WhiteClan]: "..txt)
     elseif player(id,"team")==1 then
          parse("msg ©100100100"..player(id,"name").."[BlackClan]: "..txt)
     elseif player(id,"team")==3 then
          parse("msg "..player(id,"name").."[SPECATE]: "..txt)
     end
return 1
end

uhhhh try it i think it will work ...
Sorry , I can't be Perfect !
07.11.10 08:46:30 pm
Up
Glix
User
Offline Off
OK,guys i need help with that.
i want like. i need say !special then open menu
in menu are like this.
-Vip <-i need press vip then work my vippass script
-Vodka <-i need press vodka then work my vodka script

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("say","tele")
function tele(id,txt)
if txt == "!vippass" then
parse("sv_msg2 "..id.." You are now on Vip Room")
parse("setpos "..id.." 2694 2118")
parse("equip "..id.." 88")
parse("equip "..id.." 6")
parse("equip "..id.." 45")
parse("speedmod "..id.." 50")
parse("setmaxhealth "..id.." 150")
end
end



addhook("say","tele")
function tele(id,txt)
if txt == "!vodka" then
parse("sv_msg2 "..id.." You have drinked Vodka")
parse("shake "..id.." 1000")
parse("sethealth "..id.." 80")
end
end
Create free website for your clan! Create server control panel webE --->http://www.000webhost.com/581961.html
07.11.10 09:48:43 pm
Up
TDShuft
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("say","tele")
function tele(id,txt)
if txt == "!special" then
menu(id,"Special Menu,Vip,Vodka")
end
end
addhook("menu","menu")
function menu(id,t,b)
if t=="Special Menu" then
if b==1 then
parse("sv_msg2 "..id.." You are now on Vip Room")
parse("setpos "..id.." 2694 2118")
parse("equip "..id.." 88")
parse("equip "..id.." 6")
parse("equip "..id.." 45")
parse("speedmod "..id.." 50")
parse("setmaxhealth "..id.." 150")
elseif b==2 then
parse("sv_msg2 "..id.." You have drinked Vodka")
parse("shake "..id.." 1000")
parse("sethealth "..id.." 80")
end
end
end
Sorry , I can't be Perfect !
08.11.10 11:18:45 am
Up
Zuhair103
User
Offline Off
if i make lua script i make so badly huhahahahahahahhhhhhhhhhhimmmm crazyyyyyyy
08.11.10 02:45:48 pm
Up
Sudden Death
User
Offline Off
zuhair103
i made shits too never work xd
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
08.11.10 03:14:54 pm
Up
RyceR
User
Offline Off
how to do this?:
when i go to player, he get aut like in fifa2D mod.
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
08.11.10 09:29:04 pm
Up
EngiN33R
Moderator
Offline Off
@RyceR

Please explain what do you want to do better. If you want player to get teleported somewhere when you're near him,

Code:
1
2
3
4
5
6
7
8
9
10
11
teleport1=1337 -- (pixel position)
teleport2=1337 -- (pixel position)

addhook("movetile","kickthebastard")
function kickthebastard(id,x,y)
     for id2=1,32 do
          if (x==player(id2,"tilex") and y==player(id2,"tiley")) then
               parse("setpos "..id2.." "..teleport1.." "..teleport2)
          end
     end
end
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
08.11.10 09:57:10 pm
Up
RyceR
User
Offline Off
@GlockPwner dont work
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
09.11.10 08:52:26 am
Up
Glix
User
Offline Off
Code:
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
addhook("say","tele")
function tele(id,txt)
if txt == "!menu" then
menu(id,"Special Menu,Vip,Vodka")
end
end
addhook("menu","menu")
function menu(id,t,b)
if t=="Vip menu Menu" then
if b==1 then
parse("sv_msg2 "..id.." You are now on Vip Room")
parse("setpos "..id.." 2694 2118")
parse("equip "..id.." 88")
parse("equip "..id.." 6")
parse("equip "..id.." 45")
parse("speedmod "..id.." 50")
parse("setmaxhealth "..id.." 150")
elseif b==2 then
parse("sv_msg2 "..id.." You have drinked Vodka")
parse("shake "..id.." 1000")
parse("sethealth "..id.." 80")
elseif b==3 then
parse("say "6sg3losa"")
end
end
end

addhook("say","broadcast") function broadcast(id,t)
     if string.sub(t,1,10) == "6sg3losa" then
          local bt = string.sub(t,12)
          msg("©000255000"..player(id,"name").."(V.I.P): "..bt.."@C")
     end
end


>What wron with it Help me please
edited 1×, last 09.11.10 10:42:24 am
Create free website for your clan! Create server control panel webE --->http://www.000webhost.com/581961.html
09.11.10 11:17:54 am
Up
FiiD
User
Offline Off
Can any say me is there a chance to trigger something with LUA scripts but not every minute...I want more minutes...
09.11.10 04:05:26 pm
Up
Yasday
User
Offline Off
FiiD has written:
Can any say me is there a chance to trigger something with LUA scripts but not every minute...I want more minutes...


Code:
1
2
3
4
5
6
7
8
9
10
timelimit = 30
time = 0

addhook([[minute]],[[triggers]])
function triggers()
     time = time + 1
     if time == timelimit then
          parse([[trigger NAME]])
     end
end
09.11.10 05:21:05 pm
Up
SkullFace
User
Offline Off
wawawa can somebody help me with this script ? i wanted to make that when a player changes his gun that he doesnt change gun :S ( i think i said it correctly) like player has usp and he changes it to a knife BUT lua changes it back again to usp
Code:
1
2
3
4
5
addhook("select","**CENSURED**")
function **CENSURED**(id,type,mode)
if player(id,"team") == 1 then
if player **** <---- IM STUCK HERE
end
IMG:https://i.imgur.com/kZBVkjM.gif
P.S. - I've been extracting recently enviromental sound files from other games, if anyone is interested in them for adding them to their maps, scripts, PM me
09.11.10 05:26:55 pm
Up
brk951753
User
Offline Off
function player_admin(id)
admins = {18511,17740,20909,19647,19222,15972,17327,14584,22033,23376,18411,22472,25214,20742,21836,25299,30955} -- Write admins usgn at Here (Separed with coma)
for _, usgn in pairs(admins) do
if usgn == player(id,"usgn") then
return true
end
end
return false
end

i need this with ip(not usgn)


usid = {20742,19222}

addhook("say", "saidsa")

function saidsa (id,s)
if ( s:lower() == "!xxxx" ) then
for i = 1, #usidaa do
if ( player(id, "usgn") == usid[i] ) then
break
end
end
end
end

and i need this with ip (remove usgn and add ip)

if you are admin and your ip is in lua and if you say !xxxx
parse(xxx)


help me
09.11.10 05:51:45 pm
Up
StirlizZ-Fapicon
Super User
Offline Off
This message flood my console after roundstart :
Code:
1
Net: Recelved damaged or unknown msg


Wut is that and how to remove it?
CS2d for ANDROID Discord server is here: https://discord.gg/ww59nvf
09.11.10 07:53:59 pm
Up
FiiD
User
Offline Off
Yasday has written:
Code:
1
2
3
4
5
6
7
8
9
10
timelimit = 30
time = 0

addhook([[minute]],[[triggers]])
function triggers()
     time = time + 1
     if time == timelimit then
          parse([[trigger NAME]])
     end
end


Thank you really really much...it will be a BIG help in my new map...
To the start Previous 1 2 ... 302 303 304 ... 338 339 Next To the start