Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 02-10-2015, 07:17 AM   #1
[TALOS]Smoke
 
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
[TALOS]Smoke is offline   Reply With Quote


Old 02-10-2015, 05:43 PM   #2
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
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 ]
R00Kie is offline   Reply With Quote


1 members found this post helpful.
Old 02-10-2015, 11:36 PM   #3
[TALOS]Smoke
 
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!
[TALOS]Smoke is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:03 AM.


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