View Single Post
Old 10-26-2013, 02:45 AM   #98
Dexter
internet user
Fortress Forever Staff
 
Dexter's Avatar
 
Join Date: Jun 2007
Posts Rated Helpful 42 Times
try this for base_gen : ondamage (and generators)

Code:
generators = 
{
	status = 0,
	repair_status = 0
}	

function base_gen:ondamage()
	if info_classname == "ff_weapon_spanner" then
		generators.repair_status = generators.repair_status + 1
		if generators.repair_status >= NUM_HITS_TO_REPAIR then
			local player = CastToPlayer( GetPlayerByID(info_attacker) )
			player:AddFortPoints( FORT_POINTS_PER_REPAIR, "Repairing the Crane" )
			OutputEvent( "beam2", "TurnOn" )
			OutputEvent( "tele_2_trigger", "Enable" )
			BroadCastMessage("Beam 2 has been activated")
			generators.repair_status = 0
		else 
			gen_onclank( player )
		end
	end

	return true
end
__________________
9:17 PM - DEXTER: can you teach me how to play o
9:17 PM - squeek.: you jump a lot
9:18 PM - squeek.: and do sweet moves

8:55 PM - FDA: fart in you fridge and blame it on wild animals
Dexter is offline   Reply With Quote