Bridget |
06-27-2009 07:03 AM |
I'm presuming you mean like a detpack wall. There's some lua in the ff_bases (by Squeek?) for the generator at flag location that can be destroyed for points. Here it is edited a bit.
Code:
game_ended = false
function restart_round()
game_ended = false
RespawnAllPlayers()
ResetMap()
end
fr_computer = trigger_ff_script:new({ team = Team.kUnassigned, enemy_team = Team.kUnassigned })
function fr_computer:onexplode( explosion_entity )
if IsDetpack( explosion_entity ) then
if game_ended == false then
local detpack = CastToDetpack(explosion_entity)
if detpack:GetTeamId() == self.team then return EVENT_ALLOWED end
local points = 5
local team = detpack:GetTeam()
team:AddScore(points)
local player = detpack:GetOwner()
player:AddFortPoints(points * 100, "Destroyed Mainframe" )
SmartMessage(player, "You destroyed the enemy mainframe!", "Your team
destroyed the enemy mainframe!", "Your mainframe has been destroyed!")
game_ended = true
AddSchedule( "restart_round", 5, restart_round )
end
end
return EVENT_ALLOWED
end
blue_computer = fr_computer:new({ team = Team.kBlue, enemy_team = Team.kRed })
red_computer = fr_computer:new({ team = Team.kRed, enemy_team = Team.kBlue })
This is it, edited. I'm not sure how good of a job I did editing it. Essentially, once the detpack area is destroyed (trigger brush named "x_computer", x is color) it sets game_ended to true, which prevents any more detpacks from affecting the same trigger or your team's trigger. Then, after five seconds, the map is renewed and players respawned. You can edit it further from here. You can use outputs to make the ground shake with an env_shake, force sounds to play, or make func_breakables break. I hope it works properly (My test worked fine. But, try it with multiple people.) :s
|