Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2302 303 304338 339 Next To the start

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
Joaopcvcastro has written
Please, what im doing worng? can someone help?
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

old Re: Lua Scripts/Questions/Help

Glix
User Off Offline

Quote
Please can you help me with this

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

old Re: Lua Scripts/Questions/Help

Fehu
User Off Offline

Quote
steam-cs2d has written
Please can you help me with this

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

old Re: Lua Scripts/Questions/Help

Fasttt
User Off Offline

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

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

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

old Re: Lua Scripts/Questions/Help

Glix
User Off Offline

Quote
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

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

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
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

old hah shit

Zuhair103
User Off Offline

Quote
if i make lua script i make so badly huhahahahahahahhhhhhhhhhhimmmm crazyyyyyyy

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
@RyceR

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

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

old Re: Lua Scripts/Questions/Help

Glix
User Off Offline

Quote
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

old .YeaH.

FiiD
User Off Offline

Quote
Can any say me is there a chance to trigger something with LUA scripts but not every minute...I want more minutes...

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

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


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

old Re: Lua Scripts/Questions/Help

Casper-
User Off Offline

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

old Re: Lua Scripts/Questions/Help

brk951753
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

FiiD
User Off Offline

Quote
Yasday has written
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 2302 303 304338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview