View Single Post
Old 10-27-2010, 08:19 PM   #15
Jay Mofo Mills
Jay|mOfO|Mills
Beta Tester
 
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches
Posts Rated Helpful 8 Times
This is the exact code I just tried out below. Still does not re-enable. I don't really know shit about .lua but could it be because disable_time is not called as some kind of function of the trigger? It gives me points the first time I run through the trigger, it displays the messages, just never reactivates the trigger.

I have tried using the base_score_trigger as both info_ff_script and trigger_ff_script with the same result.



base_score_trigger = trigger_ff_script:new({
can_score = true,
disable_time = 5,
score = 0,
})

function base_score_trigger:reset_scoring() self.can_score = true end

function base_score_triggerntouch(touch_entity)
if IsPlayer(touch_entity) then
local player = CastToPlayer(touch_entity)
if self.can_score then
player:AddFortPoints(self.score, "Nice Conc!")
BroadCastMessageToPlayer(player, "You've been awarded bonus points!")
self.can_score = false
AddSchedule("Re-Enable Scoring", self.disable_time, self.reset_scoring)
end
end
return true
end

beg_points = base_score_trigger:new({ score = 1 })
med_points = base_score_trigger:new({ score = 2 })
adv_points = base_score_trigger:new({ score = 3 })
crow_points = base_score_trigger:new({ score = 10 })
Jay Mofo Mills is offline   Reply With Quote