Lua Scripts/Questions/Help
6,770 repliesJoaopcvcastro has written:
Please, what im doing worng? can someone help?
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
Code:
1
2
3
4
2
3
4
addhook("startround","starting")
function starting(mode)
parse("trigger ENTITY_NAME")
end
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 !
Strange... the function starting (MODE) is to change for something?
But i will try it once more
Anyway, thanks for the help
But i will try it once more
Anyway, thanks for the help

Please can you help me with this
What wrong with it
Code:
1
2
3
4
5
6
7
8
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
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
steam-cs2d has written:
Please can you help me with this
What wrong with it
Code:
1
2
3
4
5
6
7
8
9
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
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
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
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 ???
@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
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
Code:
1
2
3
4
5
6
7
8
9
10
11
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
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 !
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
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
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
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
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
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
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
if i make lua script i make so badly huhahahahahahahhhhhhhhhhhimmmm crazyyyyyyy

zuhair103
i made shits too
never work xd
i made shits too

Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
@RyceR
Please explain what do you want to do better. If you want player to get teleported somewhere when you're near him,
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
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
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.
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
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
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

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
Can any say me is there a chance to trigger something with LUA scripts but not every minute...I want more minutes...
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
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
time = 0
addhook([[minute]],[[triggers]])
function triggers()
time = time + 1
if time == timelimit then
parse([[trigger NAME]])
end
end
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
2
3
4
5
addhook("select","**CENSURED**")
function **CENSURED**(id,type,mode)
if player(id,"team") == 1 then
if player **** <---- IM STUCK HERE
end
function **CENSURED**(id,type,mode)
if player(id,"team") == 1 then
if player **** <---- IM STUCK HERE
end

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
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

This message flood my console after roundstart
:
Wut is that and how to remove it?

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