Post: My Luna Lander Script [Needs Testing]
06-03-2011, 05:09 PM #1
nay1995
The Master
(adsbygoogle = window.adsbygoogle || []).push({}); First goto onPayerSpawned() AND PUT THIS
self.lander = false;


    // LunaLander is the function.

LunaLander(depart, pass1, pass2, pass3, pass4, arivee, angle, time)
{
Asc = spawn("script_model", depart );
Asc setModel("war_hq_obj"); // need to change to something more realistic, i carnt find any decent one's, try find one with a circular base...
Asc.angles = angle;
Asc setContents( 1 );
Asc = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 0, 30 );

Asc thread CreateLL();
Asc thread Move(depart, arivee, pass1, pass2, pass3, pass4, time);
}

CreateLL()
{
players = level.players;
for ( index = 0; index < players.size; index++ )
{
player = players[index];
if(player.lander = false)
{
if(Distance(depart, player.origin) <= 50)
{
player iPrintlnBold("Press [{+usereload}] To Use The Lander [Cost: 250]");
if(player UseButtonPressed && player.score >= 250)
{
player.score -= 250;
player freezeControls(true);
player.lander = true;
}
else
{
player iPrintlnBold("Not Enough ££");
}
}
}
}
}

Move(depart, pass1, pass2, pass3, pass4, arivee, time)
{
while(1)
{
if(self.state == "open"){
self MoveTo(depart, time);
wait (time*1.5);
self.state = "op";
continue;
}
if(self.state == "op"){
self MoveTo(pass1, time);
wait (time);
self.state = "opi";
continue;
}
if(self.state == "opi"){
self MoveTo(pass2, time);
wait (time);
self.state = "opa";
continue;
}
if(self.state == "opa"){
self MoveTo(pass3, time);
wait (time);
self.state = "ope";
continue;
}
if(self.state == "ope"){
self MoveTo(pass4, time);
wait (time);
self.state = "close";
continue;
}
if(self.state == "close"){
self MoveTo(arivee, time);
wait (time);
self.state = "open"; continue;
} self thread doEnd();
self freezeControls(false);

}
}

doEnd()
{
wait 45;
self.lander = false;
self iPrintlnBold("Lander Restored");
}
else
{
self iPrintlnBold("You Must Wait 45 Seconds For The Lander To Restore");
}


You must first thread create a map function, simpy go to rank.gsc and go to the init()
thenthread the the maps, so level thread maps\mp\gametypes\yourGsc::Maps();
then simply Maps(){} in Your chosen .gsc and in the maps place this

if(getDvar("mapname") == "mp_mapname
level thread mapname
}

mapname()
{
LunaLander((put co-ordinates here))
}

Then pack it together

and you must tell the game what self.score is, so you have to put a score function in, so this code is basically for hawkins when he reads it.
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked nay1995 for this useful post:

INSAN3LY_D34TH
06-13-2011, 08:06 PM #20
coolbunny1234
the bunny who started it all
Originally posted by nay View Post
syntax is to many open braces, not enough braces or your missing a ;, and if you look at mine it is non of those, if it got anything it would be unknown function


This is a completely false statement for the record.

And your approaching this wrong, trying to make it into one function is going to be a pain in the ass.

    
/*
You're going to have to edit the positions for this entire code, as this is all for der reise.
Also going to need to remove the level.effects. Do NOT post this code elsewhere on the web, please.
-B
*/

doLunarLander()
{
self.LunasSpawned = true;
self thread platform_Models();
self thread platform_playerFalse();
self thread platform_R();
self thread platform_R2();
}
platform_Models()
{
self endon("disconnect");
level.LunarInUse = false;
level.LunarPosition = "Spawn";
//Current positions are on der reise, edit for mp.
SpawnPos = ( 52, -440, 1.8 );
level.Lunar1 = spawn( "script_model", SpawnPos );
level.Lunar1 setmodel( "BASE MODEL" );
level.Lunar2 = spawn( "script_model", level.Lunar1.origin );
level.Lunar2 setModel( "BASE MODEL" );
level.Lunar2.angles = ( -180, 0, 0 );
level.Lunar2 linkto( level.Lunar1 );
level.CtrlPan2 = spawn( "script_model", level.Lunar1.origin + ( 0, 8, 25 ) );
level.CtrlPan2 setmodel( "CONTROL MODEL" );
level.CtrlPan2.angles = ( 0, 180, 0 );
level.CtrlPan2 linkto( level.Lunar1 );
level.CtrlPan = spawn( "script_model", level.Lunar1.origin + ( 0, -8, 25 ) );
level.CtrlPan setmodel( "CONTROL MODEL" );
level.CtrlPan linkto( level.Lunar1 );
level.PlayerOrig0 = spawn( "script_model", level.Lunar1.origin + ( 0, 50, 10 ) );
level.PlayerOrig0 linkto( level.Lunar1 );
level.PlayerOrig2 = spawn( "script_model", level.Lunar1.origin + ( 0, -50, 10 ) );
level.PlayerOrig2 linkto( level.Lunar1 );
level.PlayerOrig3 = spawn( "script_model", level.Lunar1.origin + ( 50, 0, 10 ) );
level.PlayerOrig3 linkto( level.Lunar1 );
level.PlayerOrig4 = spawn( "script_model", level.Lunar1.origin + ( -50, 0, 10 ) );
level.PlayerOrig4 linkto( level.Lunar1 );
/*
level._effect["zombie_flashback_american"] = loadfx( "maps/zombie/fx_zombie_flashback_american" );
playfx( level._effect["zombie_flashback_american"], SpawnPos );
playfx( level._effect["zombie_flashback_american"], SpawnPos );
playfx( level._effect["zombie_flashback_american"], ( 300, -1740, 58 ) );
playfx( level._effect["zombie_flashback_american"], ( 300, -1740, 58 ) );
*/
}
platform_R()
{
self endon("disconnect");
level thread add_zombie_hint( "Trigger_1", "Press &&1 To Use Lunar Lander" );
level.trig = spawn( "trigger_radius", level.Lunar1.origin, 1, 50, 20 );
level.trig SetCursorHint( "HINT_NOICON" );
level.trig UseTriggerRequireLookAt();
level.trig set_hint_string( level.trig, "Trigger_1" );
cost = 0;
for(;Winky Winky
{
level.trig waittill( "trigger", i );
if( i UseButtonPressed() && level.LunarPosition == "Spawn" && level.LunarInUse == false)
{
if(//Removed Minus Score Function)
{
level.LunarInUse = true;
level.trig SetHintString( "Lunar Lander In Use" );
level.trig2 SetHintString( "Lunar Lander In Use" );
i platform_Spawn2Dest();
level.LunarPosition = "Destination";
level.LunarInUse = false;
level.trig SetHintString( "Press &&1 To Call Lunar Lander" );
level.trig2 SetHintString( "Press &&1 To Use Lunar Lander" );
}
else
{
i iPrintln("^1Not Enough Points");
}
}
if( i UseButtonPressed() && level.LunarPosition == "Destination" && level.LunarInUse == false)
{
level.LunarInUse = true;
level.trig SetHintString( "Lunar Lander In Use" );
level.trig2 SetHintString( "Lunar Lander In Use" );
i platform_Dest2Spawn();
level.LunarPosition = "Spawn";
level.LunarInUse = false;
level.trig SetHintString( "Press &&1 To Use Lunar Lander" );
level.trig2 SetHintString( "Press &&1 To Call Lunar Lander" );
}
}
}
platform_R2()
{
self endon("disconnect");
DestPos = ( 300, -1740, 63 );
level thread add_zombie_hint( "Trigger_1", "Press &&1 To Use Lunar Lander" );
level.trig2 = spawn( "trigger_radius", DestPos, 1, 50, 20 );
level.trig2 SetCursorHint( "HINT_NOICON" );
level.trig2 UseTriggerRequireLookAt();
level.trig2 set_hint_string( level.trig2, "Trigger_2" );
cost = 0;
for(;Winky Winky
{
level.trig2 waittill( "trigger", i );
if( i UseButtonPressed() && level.LunarPosition == "Spawn"&& level.LunarInUse == false)
{
level.LunarInUse = true;
level.trig SetHintString( "Lunar Lander In Use" );
level.trig2 SetHintString( "Lunar Lander In Use" );
i platform_Spawn2Dest();
level.LunarPosition = "Destination";
level.LunarInUse = false;
level.trig SetHintString( "Press &&1 To Call Lunar Lander" );
level.trig2 SetHintString( "Press &&1 To Use Lunar Lander" );
}
if( i UseButtonPressed() && level.LunarPosition == "Destination" && level.LunarInUse == false)
{
if(i.score >= cost )
{
i.zombie_cost = 0;
i.score -= 0;
level.LunarInUse = true;
level.trig SetHintString( "Lunar Lander In Use" );
level.trig2 SetHintString( "Lunar Lander In Use" );
i platform_Dest2Spawn();
level.LunarPosition = "Spawn";
level.LunarInUse = false;
level.trig SetHintString( "Press &&1 To Use Lunar Lander" );
level.trig2 SetHintString( "Press &&1 To Call Lunar Lander" );
}
else
{
i iPrintln("^1Not Enough Points");
}
}
}
}
platform_Spawn2Dest()
{
self endon("disconnect");
self PlayerCheck(0,level.PlayerOrig0);
self PlayerCheck(1,level.PlayerOrig2);
self PlayerCheck(2,level.PlayerOrig3);
self PlayerCheck(3,level.PlayerOrig4);
self thread platform_effect();
self thread platform_Sound();
self thread LunarFx( ( 52, -440, 1.8 ) );
level.Lunar1 moveto( ( 85, -450, 699 ), 3, .5 );
level.Lunar1 vibrate((0,-100,0), 1.5, .4, 3);
level.Lunar1 waittill( "movedone" );
wait .2;
level.Lunar1 moveto( ( 300, -1740, 699 ), 6 );
level.Lunar1 waittill( "movedone" );
wait .2;
self thread AllDeath1();
level.Lunar1 moveto( ( 300, -1740, 58 ), 3, 0, .5 );
level.Lunar1 vibrate((0,-100,0), 1.5, .4, 2.5);
level.Lunar1 waittill( "movedone" );
self PlayerUnlink(0);
self PlayerUnlink(1);
self PlayerUnlink(2);
self PlayerUnlink(3);
self notify( "platform_arived" );
}
platform_Dest2Spawn()
{
self endon("disconnect");
self PlayerCheck(0,level.PlayerOrig0);
self PlayerCheck(1,level.PlayerOrig2);
self PlayerCheck(2,level.PlayerOrig3);
self PlayerCheck(3,level.PlayerOrig4);
self thread platform_effect();
self thread platform_Sound();

self thread LunarFx( ( 300, -1740, 63 ) );
level.Lunar1 moveto( ( 300, -1740, 699 ), 3, .5 );
level.Lunar1 vibrate((0,-100,0), 1.5, .4, 3);
level.Lunar1 waittill( "movedone" );
wait .2;
level.Lunar1 moveto( ( 52, -440, 699 ), 6 );
level.Lunar1 waittill( "movedone" );
wait .2;
self thread AllDeath2();
level.Lunar1 moveto( ( 52, -440, 1.8 ), 3, 0, .5 );
level.Lunar1 vibrate((0,-100,0), 1.5, .4, 2.5);
level.Lunar1 waittill( "movedone" );
self PlayerUnlink(0);
self PlayerUnlink(1);
self PlayerUnlink(2);
self PlayerUnlink(3);
self notify( "platform_arived" );
}
PlayerCheck(num, origin)
{
self endon("disconnect");
P = get_players();
if( distance( P[num].origin, level.Lunar1.origin ) < 100 )
{
P[num] EnableHealthShield( true );
P[num] EnableInvulnerability();
P[num] playerLinkTo( origin );
}
}
PlayerUnlink(num)
{
self endon("disconnect");
P = get_players();
if( distance( P[num].origin, level.Lunar1.origin ) < 100 )
{
P[num] unlink();
P[num] EnableHealthShield( false );
P[num] DisableInvulnerability();
P[num].OnLunar = false;
}
}
platform_effect()
{
self endon("disconnect");
self endon("platform_arived");
for(;Winky Winky
{
earthquake (.15, .2, level.Lunar2.origin, 500);
wait .2;
}
}
platform_Sound()
{
self endon("disconnect");
self endon("platform_arived");
for(;Winky Winky
{
playsoundatposition( "wpn_flmthwr_mn_flame", level.Lunar2.origin );
self PlaySound("wpn_flmthwr_mn_flame","wpn",true);
wait 1.5;
}
}

AllDeath1()
{
wait 2;
self thread playerDie((300, -1740, 5Cool Man (aka Tustin), 0);
self thread playerDie((300, -1740, 5Cool Man (aka Tustin), 1);
self thread playerDie((300, -1740, 5Cool Man (aka Tustin), 2);
self thread playerDie((300, -1740, 5Cool Man (aka Tustin), 3);

}
AllDeath2()
{
wait 2;
self thread playerDie((52, -440, 1.Cool Man (aka Tustin), 0);
self thread playerDie((52, -440, 1.Cool Man (aka Tustin), 1);
self thread playerDie((52, -440, 1.Cool Man (aka Tustin), 2);
self thread playerDie((52, -440, 1.Cool Man (aka Tustin), 3);
}
playerDie(ent,num)
{
self endon("disconnect");
self endon("platform_arived");
P = get_players();
for(;Winky Winky
{
XAx = RandomIntRange( -110, 110 );
YAx = RandomIntRange( -110, 110 );
if( distance( P[num].origin, ent ) < 100 && P[num].OnLunar == false )
{
P[num] DoDamage( P[num].health + 999999, P[num].origin, undefined, undefined, "riflebullet" );
P[num] setOrigin( ent + ( XAx, YAx, 3 ) );
}
wait .01;
}
}
platform_playerFalse()
{
for( i = 0;i < get_players().size;
i++ )
{
get_players()[i].OnLunar = false;
}
}
LunarFx( orig )
{
self endon("disconnect");
level._effect["mainframe_steam"] = loadfx( "maps/zombie/fx_zombie_mainframe_steam" );
a = "mainframe_steam";
playfx( level._effect[a], orig + ( 50, -50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -50, -50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 50, 50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -50, 50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 0, -50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 0, 50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -50, 0, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 50, 0, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -50, 25, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -50, -25, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 50, 25, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 50, -25, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -25, -50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( -25, 50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 25, -50, 0 ) );
wait .05;
playfx( level._effect[a], orig + ( 25, 50, 0 ) );
wait .05;
}
06-13-2011, 09:03 PM #21
Karoolus
I'm the W@W Menu Guy !
Originally posted by coolbunny1234 View Post

You're going to have to edit the positions for this entire code, as this is all for der reise.
Also going to need to remove the level.effects. Do NOT post this code elsewhere on the web, please.
-B


or you could write a little function so ppl can chose where to spawn the teleporters..
press button to get takeoff origin (have this happen in freelook or w/e)
fly to destination, press button again to set destination origin
store those in level.LL[1].origin so they can remove lunar landers & spawn new ones Happy

The following user thanked Karoolus for this useful post:

coolbunny1234
06-14-2011, 12:23 PM #22
nay1995
The Master
If you havnt realized its for multiplayer

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo