Need a script
Moderator: Core Staff
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
Need a script
Hi, i need a really special script. This is what i want. I want a script that constantly checks if someone is touching the trigger. And if some one touch it a door will be closed. I think drofder knows a way.
Thanks in advance
Thanks in advance
I will give it a shot, I asked for a script like this a while ago
Code: Select all
trig_check()
{
door = getent ("door","targetname");
trig = getent("trig_check","targetname");
trig.touch = false;
while(1)
{
players = getentarray("player","classname");
for(i=0;i<players.size;i++)
{
if(player[i] isTouching(trig))
{
trig.touch = true;
}
else
trig.touch = false;
}
if(trig.touch == true)
{
iprintlnbold("Trigger is being touched"); //Debugging, remove later when it works
door moveto ((0, 0,0), 1,0,0);
door waittill ("movedone");
}
if(trig.touch == false)
{
iprintlnbold("Trigger is not being touched"); //Debuging, remove later when it works
door moveZ (-128,2,0.5,0.5);
door waittill ("movedone");
}
}
}
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Theres possibly a slightly edasier version of the script above, but unless the one above does not work (which I cannot see why it shouldn't), then I wont be posting
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
Should it be if(players isTouching(trig)) ?
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
Who is online
Users browsing this forum: No registered users and 21 guests