Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Lua (https://forums.fortress-forever.com/forumdisplay.php?f=44)
-   -   (Request) help with a hide and seek lua function (https://forums.fortress-forever.com/showthread.php?t=24846)

[TALOS]Smoke 02-10-2015 06:17 AM

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

R00Kie 02-10-2015 04:43 PM

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


[TALOS]Smoke 02-10-2015 10:36 PM

Thanks Rookie, I'll test it a bit later!


All times are GMT. The time now is 02:16 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.