|
![]() |
#1 |
Join Date: Jul 2012
Location: Killeen, Tx, USA
Class/Position: Demo Defense Gametype: Capture the Flag Affiliations: [TALOS] Posts Rated Helpful 3 Times
|
help with a hide and seek lua function
I'm working on a map and need a lua function that makes the seekers receive no damage other than from the tranq and/or knife. I have this so far...
function player_ondamage( player, damageinfo ) if player:GetTeamId() == SEEKERS then if ( weapon == "ff_weapon_knife" ) then damageinfo:SetDamage(1); else damageinfo:ScaleDamage(0) end return end end |
![]() |
![]() |
![]() |
#2 |
Kawaii! ルーキー
Lua Team
Wiki Team Fortress Forever Staff Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random Gametype: CTF Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas Posts Rated Helpful 82 Times
|
Code:
function player_ondamage(player, damageinfo) if not damageinfo then return end local weapon = damageinfo:GetInflictor():GetClassName() if player:GetTeamId() == SEEKERS then if weapon == "ff_weapon_knife" or weapon == "ff_projectile_dart" then return else damageinfo:SetDamage(0) end end end
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ] Beta: [ Argon ] [ Reflection ] [ Urbantag ] Lua: [ game_rules ] |
![]() |
![]() 1 members found this post helpful. |
![]() |
#3 |
Join Date: Jul 2012
Location: Killeen, Tx, USA
Class/Position: Demo Defense Gametype: Capture the Flag Affiliations: [TALOS] Posts Rated Helpful 3 Times
|
Thanks Rookie, I'll test it a bit later!
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|