a script
Moderator: Core Staff
a script
would anyone happen to know how i could make a script that you have to go somehwere else in a map and press a button then it allows you to go through a teleporter, and if you dont make it back in a certain mount of time u do it again? i already have a teleporter script so i just need this 1 thx, i sux at scripting xD
I don't quite understand what you want to do. Press a button that allows you to use a teleporter, that sounds easy enough, make the button turn on the teleporter trigger?. If you don't make it back in a certain amount of time, you have to do it again. Back where? how and why do you have to get back?
Maybe you could add a wait time after you're teleported and it turns on a trigger multiple after that time. so if you were touching it after that time you could make it set the users origin.
Maybe you could add a wait time after you're teleported and it turns on a trigger multiple after that time. so if you were touching it after that time you could make it set the users origin.
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php
a script
ok, i did explain it kind of bad last time sry, ok if this helps i meant, theres a teleporter, and in order to be able to use the teleporter u have to press a certain button. Once u press the button u can then use the teleporter. thx if this helped
ok, make a two triggers one will activate(activate_trig) the other trigger(teleporter_trig).
Place them where you want and add this to your script. Note: Untested.
Place them where you want and add this to your script. Note: Untested.
Code: Select all
teleporter_timer()
{
activate_trig = getent("activate_trig","targetname");
teleport_trig = getent("teleport_trig","targetname");
teleport_trig thread maps\mp\_utility::triggerOff();
while(1)
{
activate_trig waittill ("trigger");
teleport_trig thread maps\mp\_utility::triggerOn();
wait 10;
teleport_trig thread maps\mp\_utility::triggerOff();
}
}
teleporter()
{
while(1)
{
players = getentarray("player", "classname");
for(i=0;i<players.size;i++)
{
finishtrig = getent ("teleport_trig","targetname");
finishtrig waittill ("trigger",user);
user setOrigin( (452, 1072,168) );
}
wait .5;
}
}
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]
a script
thx, but would u no where the bad syntax is in the script? i get error bad syntax
Code: Select all
main()
{
thread teleporter_timer();
{
teleporter_timer()
{
activate_trig = getent("activate_trig","targetname");
teleport_trig = getent("teleport_trig","targetname");
teleport_trig thread maps\mp\_utility::triggerOff();
while(1)
{
activate_trig waittill ("trigger");
teleport_trig thread maps\mp\_utility::triggerOn();
wait 10;
teleport_trig thread maps\mp\_utility::triggerOff();
}
}
teleporter()
{
while(1)
{
players = getentarray("player", "classname");
for(i=0;i<players.size;i++)
{
finishtrig = getent ("teleport_trig","targetname");
finishtrig waittill ("trigger",user);
user setOrigin( (452, 1072,168) );
}
wait .5;
}
}
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
Yeah, from having a quick look it looks like the teleporter thread isn't being threaded, and the main thread wasn't closed with a }.
Try
Try
Code: Select all
main()
{
thread teleporter_timer();
thread teleporter();
}
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php
a script
k thx luke that got rid of the error, but tell me if im doing this wrong plz cause this is wut i did and its not working, first i just made a small button and put i trigger use right near it, i named the trigger use activate_trig, then i made a trigger multiple for the teleporter and named it teleport_trig. then i made the trigger multiple for the teleporter a target also, which i just named hi then i made a script origin and that had a targetname which was hi. then it didnt work. tell me if im doing something rong plz, thxill try and look out if i named something rong or something
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
no problem man
I am starting to beat drof at this. Watch out drof, your days are numbered
I am starting to beat drof at this. Watch out drof, your days are numbered

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: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
a script
ok, wen i use the moving platform script from nightmares tut it works but when i try to put more directions in for platform to do, it does it on the rong side it does them backyards. any idea? the scripts are
and , so they do work but it does it in reverse
Code: Select all
main()
{
thread platform1();
}
platform1()
{
platform = getent ("platform1","targetname");
while(1)
{
platform moveY (88,1,0.3,0.3);
wait(5);
platform moveZ (188,1,0.3,0.3);
wait(5);
platform moveX (266,1,0.3,0.3);
wait(5);
platform moveZ (266,1,0.3,0.3);
wait(5);
platform moveY (200,1,0.3,0.3);
wait(5);
platform moveX (266,1,0.3,0.3);
wait(5);
platform moveY (266,1,0.3,0.3);
wait(5);
platform moveZ (266,1,0.3,0.3);
wait(5);
platform moveY (266,1,0.3,0.3);
wait(5);
platform moveZ (195,1,0.3,0.3);
wait(5);
platform moveZ (-195,1,0.3,0.3);
wait(5);
platform moveY (-266,1,0.3,0.3);
wait(5);
platform moveZ (-266,1,0.3,0.3);
wait(5);
platform moveY (-266,1,0.3,0.3);
wait(5);
platform moveX (-266,1,0.3,0.3);
wait(5);
platform moveY (-200,1,0.3,0.3);
wait(5);
platform moveZ (-266,1,0.3,0.3);
wait(5);
platform moveX (-266,1,0.3,0.3);
wait(5);
platform moveZ (-188,1,0.3,0.3);
wait(5);
platform moveY (-88,1,0.3,0.3);
wait(5);
platform waittill ("movedone");
}
}
Code: Select all
main()
{
thread platform2();
}
platform2()
{
platform = getent ("platform2","targetname");
trigger = getent ("trig_platform","targetname");
while(1)
{
platform moveY (88,1,0.3,0.3);
wait(5);
platform moveZ (188,1,0.3,0.3);
wait(5);
platform moveX (266,1,0.3,0.3);
wait(5);
platform moveZ (266,1,0.3,0.3);
wait(5);
platform moveY (200,1,0.3,0.3);
wait(5);
platform moveX (266,1,0.3,0.3);
wait(5);
platform moveY (266,1,0.3,0.3);
wait(5);
platform moveZ (266,1,0.3,0.3);
wait(5);
platform moveY (266,1,0.3,0.3);
wait(5);
platform moveZ (195,1,0.3,0.3);
wait(5);
platform moveZ (-195,1,0.3,0.3);
wait(5);
platform moveY (-266,1,0.3,0.3);
wait(5);
platform moveZ (-266,1,0.3,0.3);
wait(5);
platform moveY (-266,1,0.3,0.3);
wait(5);
platform moveX (-266,1,0.3,0.3);
wait(5);
platform moveY (-200,1,0.3,0.3);
wait(5);
platform moveZ (-266,1,0.3,0.3);
wait(5);
platform moveX (-266,1,0.3,0.3);
wait(5);
platform moveZ (-188,1,0.3,0.3);
wait(5);
platform moveY (-88,1,0.3,0.3);
wait(5);
platform waittill ("movedone");
}
}
then what you want to do is switch the negatives in front of the first numbers
also add a after every movement to ensure that your platforms are glitch free
also add a
Code: Select all
platform 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]
Who is online
Users browsing this forum: No registered users and 0 guests