08-29-2009, 04:16 AM | #1 |
FF Loremaster
Beta Tester
Join Date: Sep 2007
Posts Rated Helpful 4 Times
|
Kill lasers a-la Aardvark
Or really, any other map that has them. I'm using the aardvark LUA for a basis of my maps LUA because it has things pretty close to what I want from my map anyway.
However, I'm having some problems with getting the kill lasers to work. From the Aardvark LUA: Code:
----------------------------------------------------------------------------- -- aardvark lasers and respawn shields ----------------------------------------------------------------------------- KILL_KILL_KILL = trigger_ff_script:new({ team = Team.kUnassigned }) lasers_KILL_KILL_KILL = trigger_ff_script:new({ team = Team.kUnassigned }) function KILL_KILL_KILL:allowed( activator ) local player = CastToPlayer( activator ) if player then if player:GetTeamId() == self.team then return EVENT_ALLOWED end end return EVENT_DISALLOWED end function lasers_KILL_KILL_KILL:allowed( activator ) local player = CastToPlayer( activator ) if player then if player:GetTeamId() == self.team then if self.team == Team.kBlue then if redsecstatus == 1 then return EVENT_ALLOWED end end if self.team == Team.kRed then if bluesecstatus == 1 then return EVENT_ALLOWED end end end end return EVENT_DISALLOWED end blue_slayer = KILL_KILL_KILL:new({ team = Team.kBlue }) red_slayer = KILL_KILL_KILL:new({ team = Team.kRed }) sec_blue_slayer = lasers_KILL_KILL_KILL:new({ team = Team.kBlue }) sec_red_slayer = lasers_KILL_KILL_KILL:new({ team = Team.kRed })
__________________
"The nine most terrifying words in the English language are: 'I'm from the government and I'm here to help.'" Ronald Reagan |
|
08-29-2009, 04:29 AM | #2 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Code:
kill_trigger = trigger_ff_script:new({team = Team.kUnassigned}) red_spawn = kill_trigger:new({team = Team.kRed}) blue_spawn = kill_trigger:new({team = Team.kBlue}) function kill_trigger:allowed(activator) if IsPlayer(activator) then local player = CastToPlayer(activator) if player:GetTeamId() == self.team then return EVENT_ALLOWED end end return EVENT_DISALLOWED end |
|
08-29-2009, 03:13 PM | #3 |
Lua Team
Join Date: Mar 2007
Posts Rated Helpful 1 Times
|
The actual lasers are just env_laser's that don't do any damage. The damage is done by a trigger_hurt called blue_slayer or sec_red_slayer.
The variables bluesecstatus and redsecstatus determine if the trigger_hurt do any damage. The visible lasers need to be turned on and off by logic relays in your map. don't call a trigger hurt "red_spawn". That name is taken for spawn points |
|
08-29-2009, 05:36 PM | #4 |
FF Loremaster
Beta Tester
Join Date: Sep 2007
Posts Rated Helpful 4 Times
|
Thanks to the two of you. Got it working.
__________________
"The nine most terrifying words in the English language are: 'I'm from the government and I'm here to help.'" Ronald Reagan |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|