Trigger to kill when player enters sniperroom

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
DrunK
Private
Posts: 3
Joined: Fri Mar 28, 2008 9:03 am

Trigger to kill when player enters sniperroom

Post by DrunK »

ok so im trying to make a trigger so when u go up the ladder to the sniper room in malta that u die... im adding the script to the malta.scr in another mod for softwalls.. but everytime i pack it back up and upload it the mod for softwalls dont work at all.. what am i doing wrong.. btw im pretty sure this script is right but please check

**EDIT** the .pk3 has several mods in it including 3rd person mod and a mod to take out the mg42s.. the whole mod doesnt work when i include the trigger in it.. so it has to be im retarded and cant script

Code: Select all

main:

level.script = maps/dm/MP_Malta_DM.scr

level.music = mp_malta_dm

 

setcvar "g_scoreboardpic" "mp_malta_dm"

if(level.roundbased)

thread roundbasedthread

 

level waittill prespawn

 

exec global/ambient.scr

exec global/DMprecache.scr

exec global/door_locked.scr

exec global/exploder.scr





if (int (getcvar(g_gametype)) == 1)

     {

     setcvar "g_gametypestring" ".:{{D*A*C}}:. FFA"

     }



$alliedmortar.collisionent = $granatwerfer_collision

$alliedmortar_turret0.collisionent = $granatwerfer_turret_collision

$alliedmortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_d.tik" $granatwerfer_destroyed_collision

$alliedmortar_turret0 maxyawoffset "40"

$alliedmortar2.collisionent = $granatwerfer_collision

$alliedmortar2_turret0.collisionent = $granatwerfer_turret_collision

$alliedmortar2 thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_d.tik" $granatwerfer_destroyed_collision

$alliedmortar2_turret0 maxyawoffset "40"

 

$axismortar.collisionent = $granatwerfer_collision

$axismortar_turret0.collisionent = $granatwerfer_turret_collision

$axismortar thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_d.tik" $granatwerfer_destroyed_collision

$axismortar_turret0 maxyawoffset "40"

$axismortar2.collisionent = $granatwerfer_collision

$axismortar2_turret0.collisionent = $granatwerfer_turret_collision

$axismortar2 thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_d.tik" $granatwerfer_destroyed_collision

$axismortar2_turret0 maxyawoffset "40"

level waittill spawn

// Add in our clip brush at the cheat point.

local.clipbrush = spawn script_object

local.clipbrush.origin = ( -1056 -384 -1412 )

local.clipbrush setsize ( -36 -16 -76 ) ( 36 16 76 )

local.clipbrush solid

$mg42 pitchcaps ( -25 45 0)

$mg42 maxyawoffset "80"

$mg42_2 pitchcaps ( -25 45 0)

$mg42_2 maxyawoffset "65"

level.portcullis_open = 1

$trapdoor thread trapdoor_init

$portcullis_switch bind $portcullis_switch_origin

 

//make all the switches non solid so as not to injure the player when triggered.

$portcullis_switch notsolid

$portcullis_switch_origin notsolid

$portcullis open $portcullis_entity

$walltrigger thread exploder_init 1

//$bridgetrigger thread exploder_init 2

$walltrigger2 thread exploder_init 3

$nudietrigger thread exploder_init 4

$debristrigger thread exploder_init 5

$balconytrigger thread exploder_init 6

$limestonetrigger1 thread exploder_init 7`

$limestonetrigger2 thread exploder_init 8

$towercorner_trigger thread exploder_init 9

$prisoncorner_trigger thread exploder_init 10

$bunkertrigger thread exploder_init 11

$alleytrigger thread exploder_init 12

end

 

roundbasedthread:

 

level waitTill prespawn

 

level waittill spawn

 

// set the parameters for this round based match

level.dmrespawning = 0 // 1 or 0

level.dmroundlimit = 5 // round time limit in minutes

level.clockside = kills // set to axis, allies, kills, or draw

 

level waittill roundstart

$portcullis open $portcullis_entity

 

//--------------------------------------------------------------

//Open Portcullis

//--------------------------------------------------------------

animate_portcullis_switch:

 

dprintln "animating the switch"

dprintln "level.portcullis_open = " level.portcullis_open

if( level.portcullis_open == 1 )

{

dprintln "rotating down"

$portcullis_switch_origin speed 5

$portcullis_switch_origin rotatezdownto 180

$portcullis_switch_origin waitmove

$portcullis_switch_origin playsound switchbox

}

else

{

dprintln "rotating up"

$portcullis_switch_origin speed .1

$portcullis_switch_origin rotatezupto 0

$portcullis_switch_origin waitmove

$portcullis_switch_origin playsound switchbox

}

end

toggle_portcullis:

$portcullis_trigger nottriggerable

thread animate_portcullis_switch

if (level.portcullis_open == 1)

{

$portcullis_entity playsound portcullis_close_move

$portcullis close $portcullis_entity

wait 5

$portcullis_entity playsound portcullis_close_stop

level.portcullis_open = 0

}

else

{

$portcullis_entity playsound portcullis_open_move

$portcullis open $portcullis_entity

wait 5

$portcullis_entity playsound portcullis_open_stop

level.portcullis_open = 1

}

$portcullis_trigger triggerable

end

trapdoor_init:

self solid

self damage 0

level.trapdoor_state = 0

trapdoor_loop_start:

self waittill use

if (level.trapdoor_state == 0)

{

self thread trapdoor_open

}

else if (level.trapdoor_state == 1)

{

self thread trapdoor_close

}

goto trapdoor_loop_start

end

trapdoor_cycle local.duration:

wait local.duration

if (level.trapdoor_state == 1)

{

self thread trapdoor_close

}

end

trapdoor_open:

level.trapdoor_state = 1

self openportal

self playsound gate_wood_open_move

self rotatezupto 90

self time 1

self waitmove

self playsound gate_wood_open_stop

self thread trapdoor_cycle 15

 

end

trapdoor_close:

self playsound gate_wood_close_move

level.trapdoor_state = 0

self rotatezdownto 0

self time 1

self waitmove

self playsound gate_wood_close_stop

self closeportal

end

// Exploders

//

// Exploding Wall

exploder_init local.set:

      //remove the immunities so the walls take damage

     //self immune bash

    //self immune bullet

   //self immune shotgun

exploder_start_loop:

self waittill damage

    //dprintln "Hit! " self.health

    //if (self.health > 0)

    //goto exploder_start_loop

    //dprintln "BOOM!"

thread global/exploder.scr::explode local.set

self remove

end

local.trig = spawn trigger_multiple

local.trig.origin = (   624.00 -456.00 -960.00 )                              
local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )                          
local.trig setthread  Snipertrig1                                              
local.trig wait 1                                                              
local.trig delay 0            
                                            
Snipertrig1:                                                                                  
self waittill trigger                                                                  
local.player=parm.other                                                          
if (local.player.isSnipertrig1==1)                                                  
end                                                                                        
 

local.player.isSnipertrig1=1                                                        
local.player tele 0 0 900                                                    
wait 5    

local.player stufftext ?say ******I Tried To Camp In the Sniperroom like an Idiot!!?              
local.player kill                                                                        
local.player.isTrigger1=0                                                  
end   
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

you don't need this line..

Code: Select all

self waittill trigger 
and I think you should put it in first section of the script..
however, I think it's useless the tele command..you can let him die right there in sniper room....but this is just my opinion...
and...man you it's not a free for all without the possibility of sniping lol :?
Post Reply