help with door script

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Turbo2233
CJ Fan
CJ Fan
Posts: 116
Joined: December 8th, 2011, 1:38 pm
Location: unknown

help with door script

Post by Turbo2233 » January 28th, 2012, 2:17 pm

hi guys i am looking for a script that will open a door when pressed with use key and auto close after

thanks

Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

Re: help with door script

Post by Levcek » January 28th, 2012, 3:10 pm

make a new gsc called _door.gsc or something and put that in

main()
{
thread door();
}
door()
{
door = getent("door", "targetname"); //value,targetname in radiant
trig = getent("trig_door", "targetname"); //trigger (use use_touch trigger to make to press F)
while (1)
{
trig waittill("trigger");
door rotateyaw(90, 1.5, 0.7, 0.7);
door waittill("rotatedone");
wait (3); // Wait 3 seconds till door close (change value if u want to door close faster/slower)
door rotateyaw(-90, 1.5, 0.7, 0.7);
door waittill("rotatedone");
}
}

and now in mp_yourmapname.gsc put that in:

main()
{
mapsmp_load::main();

maps\mp\_door::main();

}
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

User avatar
Turbo2233
CJ Fan
CJ Fan
Posts: 116
Joined: December 8th, 2011, 1:38 pm
Location: unknown

Re: help with door script

Post by Turbo2233 » January 28th, 2012, 3:10 pm

thanks alot

Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

Re: help with door script

Post by Levcek » January 28th, 2012, 3:14 pm

np.. if u got errors contact me on xf :)
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with door script

Post by Goro92 » January 28th, 2012, 3:35 pm

...this code is the same of this viewtopic.php?f=29&t=14602 ...

p.s

use an origin brushes..
Image

Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

Re: help with door script

Post by Levcek » January 28th, 2012, 4:19 pm

Goro92 wrote:...this code is the same of this viewtopic.php?f=29&t=14602 ...

p.s

use an origin brushes..
yesss
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests