Good point. This should be better...StanFear wrote:first, here, you're adding the button to all player even those not in the force that did the research
Code: Select all
script.on_event(defines.events.on_research_finished, function(event)
addPlayerGui(game.get_player(event.player_index), event.research.name)
end)For no particular reason except that I don't like doing anything inside event handlers. I know it's the same, it's just personal preference.StanFear wrote:seccound, instead of passing the tech name as a parameter, why don't you do the check in the on_research_finished ?





