hi guys i am looking for a script that will open a door when pressed with use key and auto close after
thanks
help with door script
Moderator: Core Staff
-
- CJ Fan
- Posts: 116
- Joined: December 8th, 2011, 1:38 pm
- Location: unknown
-
- CJ Fan
- Posts: 129
- Joined: March 7th, 2010, 11:37 am
- Location: sLOVEnia, stajerska FTW
Re: help with door script
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();
}
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();
}
__________________________________________________________
THE MAPPER
__________________________________________________________


__________________________________________________________

-
- CJ Fan
- Posts: 116
- Joined: December 8th, 2011, 1:38 pm
- Location: unknown
Re: help with door script
thanks alot
-
- CJ Fan
- Posts: 129
- Joined: March 7th, 2010, 11:37 am
- Location: sLOVEnia, stajerska FTW
Re: help with door script
np.. if u got errors contact me on xf 

__________________________________________________________
THE MAPPER
__________________________________________________________


__________________________________________________________

-
- CJ Spammer!
- Posts: 605
- Joined: March 7th, 2011, 5:54 pm
- Location: Brescia, Italy
-
- CJ Fan
- Posts: 129
- Joined: March 7th, 2010, 11:37 am
- Location: sLOVEnia, stajerska FTW
Re: help with door script
yesssGoro92 wrote:...this code is the same of this viewtopic.php?f=29&t=14602 ...
p.s
use an origin brushes..
__________________________________________________________
THE MAPPER
__________________________________________________________


__________________________________________________________
