06-17-2009, 10:49 PM | #1 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Stopping projectiles via LUA?
Is there any way to stop rockets from passing a trigger-textured area via LUA?
Players must be able to pass, but not rockets. |
|
06-18-2009, 12:52 AM | #2 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
I think trigger_ff_clip will do this. It doesn't do everything it's supposed to do, but it does block projectiles.
|
|
06-18-2009, 12:54 AM | #3 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
You can use a trigger_remove (check "Everything" and then use the code below to only remove projectiles) or a trigger_ff_clip.
Trigger_remove (named projectile_remove) Code:
remove_projectiles = trigger_ff_script:new({ }) function remove_projectiles:allowed(allowed_entity) if IsNotProjectile(allowed_entity) then return false end return true end function IsNotProjectile( allowed_entity ) return IsPlayer(allowed_entity) || IsGrenade(allowed_entity) || IsTurret(allowed_entity) || IsDispenser(allowed_entity) || IsSentrygun(allowed_entity) || IsDetpack(allowed_entity) end Code:
projectile_clip = trigger_ff_clip:new({ clipflags = {ClipFlags.kClipProjectiles} })
__________________
#FF.Pickup ¤ Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington Last edited by squeek.; 06-18-2009 at 12:54 AM. |
|
06-18-2009, 12:59 AM | #4 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Thanks, and instead of making a new thread.. I have another question.
Currently, I have two brushes set to trigger_teleport. One to teleport to red side, one to teleport to blue side. They both work, but not as I want. So, how would I go about (through lua) only allowing (if possible) the teleporter to work if the person who enters the teleporter shares the same team as the teleporter? |
|
06-18-2009, 01:38 AM | #5 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Code:
team_only = trigger_ff_script:new({ team = Team.kUnassigned }) function team_only:allowed( allowed_entity ) if IsPlayer( allowed_entity ) then local player = CastToPlayer( allowed_entity ) -- return true if the player is on the right team return player:GetTeamId() == self.team end return EVENT_DISALLOWED end blue_only = team_only:new({ team = Team.kBlue }) red_only = team_only:new({ team = Team.kRed })
__________________
#FF.Pickup ¤ Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington Last edited by squeek.; 06-18-2009 at 01:38 AM. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|