mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-30 03:51:40 +09:00
.
This commit is contained in:
19
OLD/PHI-PB/control.lua
Normal file
19
OLD/PHI-PB/control.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local config = require 'config'
|
||||
|
||||
script.on_event(defines.events.on_player_created, function(event)
|
||||
if event.player_index == 1 then
|
||||
for k, v in pairs(config) do
|
||||
if (v.enabled) then
|
||||
game.forces.player[k] = game.forces.player[k] + v.val
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
script.on_event(defines.events.on_player_died, function(event)
|
||||
local player = game.players[event.player_index]
|
||||
|
||||
if (player.character) then
|
||||
player.ticks_to_respawn = 120
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user