Forum

> > CS2D > Scripts > Trigger menu.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Trigger menu.

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Trigger menu.

Glix
User Off Offline

Zitieren
It's possible to make with lua like when you press trigger in map then it activates menu. then you can add into menu different button what activates different triggers,dynwalls etc?

alt Re: Trigger menu.

Glix
User Off Offline

Zitieren
user Jynxxx hat geschrieben
Yes.

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
addhook("use","usebuttonworkaround")
function usebuttonworkaround(id)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==115 and y==133 then
          menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
     end
end

addhook("menu","_menu")
function _menu(id,menu,button)
if menu =="Trigger" then
	if button == 1 then
		parse("trigger zombies404")
		msg("©255000000Zombies!!")
	end
	elseif button == 2 then
		parse("trigger vortigaunt404")
		msg("©255000000ALiEEnS!!")
	end
	elseif button == 3 then
		parse("trigger headcrab404")
		msg("©255000000Headcrabs!")
	end
	elseif button == 4 then
		parse("trigger soldier404")
		msg("©255000000oMg?!")
	end
end

What wrong with this then?

alt Re: Trigger menu.

EndDead
User Off Offline

Zitieren
EDIT:
oops you posted while i was posting, anyway
Whats wrong with your script is missing 2 ends (maybe)
Add 2 ends at the bottom
--------------------------------------------------------
Old Post:
Yes, heres an example:
1
2
3
4
5
6
7
8
9
addhook("use","enddead_use")
function enddead(id)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==47 and y==11 then -- Replace 47 by tile X and 11 by tile Y for menu 1
          menu(id,"Menu,Tigger 1,Tigger 2")
     elseif x==25 and y==41 -- Replace 25 by tile X and 41 by tile Y
          menu(id,"Menu 2,Tigger 3,Tigger 4)
     end
end
and example of how can you toggle walls or buttons:
1
2
3
4
5
6
7
8
9
10
11
addhook("menu","enddead_menu")
function enddead_menu(id,title,buton)
     if title=="Menu" then
          if buton==1 then
               parse("toggle ButtonNameOrDynWallName") -- replace ButtonNameOrDynWallName by the name of the dynwall/button entity in the map
          elseif buton==2 then
               parse("toggle ButtonNameOrDynWallName") -- same
end
end
end
end
I didn't add an example for menu 2, try it yourself!

Good luck.

alt Re: Trigger menu.

ExecL
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("serveraction","A")
function A(id,action)
	if action == 1 then
		menu(id,"Menu,Dynwall")
	end
end

addhook("menu","B")
function B(id,title,button)
	if button == 1 then
		parse("trigger dynwall")
	end
end

Here this works.

alt Re: Trigger menu.

Black Wolf
User Off Offline

Zitieren
Still don't work… plz help me out i sucks i scripting...
1
2
3
4
5
6
7
8
9
10
addhook("use","enddead_use")
function enddead_use(id)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==115 and y==133 then -- Replace 47 by tile X and 11 by tile Y for menu 1
          menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
     elseif x==25 and y==41 -- Replace 25 by tile X and 41 by tile Y
          menu(id,"Menu 2,Tigger 3,Tigger 4)
end
end
end

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook("menu","enddead_menu")
function enddead_menu(id,title,buton)
     if title=="Trigger" then
          if buton==1 then
				parse("trigger zombies404")
				msg("©255000000Zombies!!") -- replace ButtonNameOrDynWallName by the name of the dynwall/button entity in the map
			elseif buton==2 then
				parse("trigger vortigaunt404")
				msg("©255000000ALiEEnS!!")	
			elseif button == 3 then
				parse("trigger headcrab404")
				msg("©255000000Headcrabs!")	
			elseif button == 4 then
				parse("trigger soldier404")
				msg("©255000000oMg?")
end
end
end
end
end
end

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook("menu","enddead_menus")
function enddead_menus(id,title,buton)
     if title=="Menu 2" then
          if buton==1 then
				parse("trigger zombies404")
				msg("©255000000Zombies!!") -- replace ButtonNameOrDynWallName by the name of the dynwall/button entity in the map
			elseif buton==2 then
				parse("trigger vortigaunt404")
				msg("©255000000ALiEEnS!!")	
			elseif button == 3 then
				parse("trigger headcrab404")
				msg("©255000000Headcrabs!")	
			elseif button == 4 then
				parse("trigger soldier404")
				msg("©255000000oMg?")
end
end
end
end
end
end

alt Re: Trigger menu.

ExecL
User Off Offline

Zitieren
user Glix hat geschrieben
Still doesn't work...


Use my one

1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("serveraction","A")
function A(id,x,y)
     local x,y=player(id,"tilex"),player(id,"tiley")
	if x==10 and y==10 then -- change this
          menu(id,"Menu,Dynwall")
     end
end

addhook("menu","B")
function B(id,title,button)
     if button == 1 then
          parse("trigger dynwall")
     end
end

alt Re: Trigger menu.

EndDead
User Off Offline

Zitieren
Ok i wasted my time and tested in-game, and heres the full script:
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
addhook("use","usebuttonworkaround")
function usebuttonworkaround(id)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==51 and y==9 then -- Replace 51 by tile X and 9 by tile Y for menu 1
          menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
     elseif x==25 and y==41 then -- Replace 25 by tile X and 41 by tile Y
          menu(id,"Menu 2,Tigger 3,Tigger 4")
     end
end

addhook("menu","enddead_menu")
function enddead_menu(id,title,buton)
     if title=="Tigger" then
          if buton==1 then
                    parse("trigger zombies404")
                    msg("©255000000Zombies!!") -- replace ButtonNameOrDynWallName by the name of the dynwall/button entity in the map
               elseif buton==2 then
                    parse("trigger vortigaunt404")
                    msg("©255000000ALiEEnS!!")     
               elseif button == 3 then
                    parse("trigger headcrab404")
                    msg("©255000000Headcrabs!")     
               elseif button == 4 then
                    parse("trigger soldier404")
                    msg("©255000000oMg?!!")
end
end
end
2× editiert, zuletzt 26.08.12 09:27:23

alt Re: Trigger menu.

Black Wolf
User Off Offline

Zitieren
user EndDead hat geschrieben
Ok i wasted my time and tested in-game, and heres the full script:
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
addhook("use","usebuttonworkaround")
function usebuttonworkaround(id)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==51 and y==9 then -- Replace 51 by tile X and 9 by tile Y for menu 1
          menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
     elseif x==25 and y==41 then -- Replace 25 by tile X and 41 by tile Y
          menu(id,"Menu 2,Tigger 3,Tigger 4")
     end
end

addhook("menu","enddead_menu")
function enddead_menu(id,title,buton)
     if title=="Tigger" then
          if buton==1 then
                    parse("trigger zombies404")
                    msg("©255000000Zombies!!") -- replace ButtonNameOrDynWallName by the name of the dynwall/button entity in the map
               elseif buton==2 then
                    parse("trigger vortigaunt404")
                    msg("©255000000ALiEEnS!!")     
               elseif button == 3 then
                    parse("trigger headcrab404")
                    msg("©255000000Headcrabs!")     
               elseif button == 4 then
                    parse("trigger soldier404")
                    msg("©255000000oMg?!!")
end
end
end


Thank you my lord!

EDIT :
Fuck this i give up. none of these work!

alt Re: Trigger menu.

ExecL
User Off Offline

Zitieren
user Black Wolf hat geschrieben
user EndDead hat geschrieben
Ok i wasted my time and tested in-game, and heres the full script:
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
addhook("use","usebuttonworkaround")
function usebuttonworkaround(id)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==51 and y==9 then -- Replace 51 by tile X and 9 by tile Y for menu 1
          menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
     elseif x==25 and y==41 then -- Replace 25 by tile X and 41 by tile Y
          menu(id,"Menu 2,Tigger 3,Tigger 4")
     end
end

addhook("menu","enddead_menu")
function enddead_menu(id,title,buton)
     if title=="Tigger" then
          if buton==1 then
                    parse("trigger zombies404")
                    msg("©255000000Zombies!!") -- replace ButtonNameOrDynWallName by the name of the dynwall/button entity in the map
               elseif buton==2 then
                    parse("trigger vortigaunt404")
                    msg("©255000000ALiEEnS!!")     
               elseif button == 3 then
                    parse("trigger headcrab404")
                    msg("©255000000Headcrabs!")     
               elseif button == 4 then
                    parse("trigger soldier404")
                    msg("©255000000oMg?!!")
end
end
end


Thank you my lord!

EDIT :
Fuck this i give up. none of these work!


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
addhook("use","_use")
function _use(id,x,y)
     local x,y=player(id,"tilex"),player(id,"tiley")
     if x==51 and y==9 then
          menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
     elseif x==16 and y==7 then 
          menu(id,"Menu 2,Tigger 3,Tigger 4")
     end
end

addhook("menu","_menu")
function _menu(id,title,button)
     if title=="Tigger" then
          if button == 1 then
                    parse("trigger zombies404")
                    msg("©255000000Zombies!!")
               elseif button == 2 then
                    parse("trigger vortigaunt404")
                    msg("©255000000ALiEEnS!!")     
               elseif button == 3 then
                    parse("trigger headcrab404")
                    msg("©255000000Headcrabs!")     
               elseif button == 4 then
                    parse("trigger soldier404")
                    msg("©255000000oMg?!!")
				end
		end
end

Fixed.

alt Re: Trigger menu.

Jynxxx
User Off Offline

Zitieren
Some people need to work on tabbing.
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
addhook("use","usebuttonworkaround")
function usebuttonworkaround(id)
	local x,y=player(id,"tilex"),player(id,"tiley")
	if x==115 and y==133 then
		menu(id,"Trigger,Apocalypse|Zombie's,Aliens|Vortigaunt's,Headcrabs|Headcrab's,4 Ops|Soldier's")
	end
end

addhook("menu","_menu")
function _menu(id,menu,button)
	if menu =="Trigger" then
		if button == 1 then
			parse("trigger zombies404")
			msg("©255000000Zombies!!")
		elseif button == 2 then
			parse("trigger vortigaunt404")
			msg("©255000000ALiEEnS!!")
		elseif button == 3 then
			parse("trigger headcrab404")
			msg("©255000000Headcrabs!")
		elseif button == 4 then
			parse("trigger soldier404")
			msg("©255000000oMg?!")
		end
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht