View Single Post
Old 02-25-2008, 02:16 AM   #4
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Re: GambiT
Code:
triggerlight = trigger_ff_script:new({ team = Team.kUnassigned })

function triggerlight:allowed( touch_entity )
	if IsPlayer( touch_entity ) then
		local player = CastToPlayer( touch_entity )
		if player:IsDisguised() == false then
			return player:GetTeamId() == self.team
		end
	end
	return EVENT_DISALLOWED
end 

function triggerlight:ontouch( touch_entity )
   if IsPlayer( touch_entity ) then 
      OutputEvent( self.light, "TurnOn" ) 
   end 
end 

function triggerlight:onendtouch( touch_entity )
   if IsPlayer( touch_entity ) then 
      OutputEvent( self.light, "TurnOff" ) 
   end 
end 

blueyardlight = triggerlight:new({ team = Team.kBlue, light = "blueyardlight_light" })
bluewolight = triggerlight:new({ team = Team.kBlue, light = "bluewolight_light" })
redyardlight = triggerlight:new({ team = Team.kRed, light = "redyardlight_light" })
redwolight = triggerlight:new({ team = Team.kRed, light = "redwolight_light" })
Also, you could have the spotlights follow the player. But with multiple players in the trigger it could be hard to make sure it works.
__________________
#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
squeek. is offline   Reply With Quote