-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontrol.lua
More file actions
40 lines (33 loc) · 813 Bytes
/
control.lua
File metadata and controls
40 lines (33 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'script.inserters'
script.on_init(
function()
game.planets.fortress.create_surface()
end)
script.on_event(defines.events.on_trigger_created_entity,
function(event)
local entity = event.entity
if not (entity and entity.valid) then
return
end
if entity.name ~= 'warp-sticker' then
return
end
local source = event.source
if not (source and source.valid) then
return
end
local character = entity.sticked_to
if not (character and character.valid) then
return
end
if character.type ~= "character" then return end
if not character.player or not character.player.valid then
return
end
local data = {
player_index = character.player.index,
entity = source,
position = source.position,
}
script.raise_event('on_player_warp_entered', data)
end)