Thanks!
______
This does not interact with the surface in the way you intend.Modraneth wrote: ↑Sat Mar 14, 2020 1:27 am where do I failed?
Code: Select all
function SpawnRewards() local s = Laurent_spot.surface for _,e in s:contents() do if e.go.name == "corga_amulet" then e.go:destroy() spawn("fire_gauntlets", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation) end end end
Try this:
Code: Select all
function SpawnRewards()
local s = Laurent_spot.surface
for _,e in s:contents() do
if e.go.name == "corga_amulet" then
e.go:destroyDelayed() --Updated as per suggestions.
s:addItem(spawn("fire_gauntlets").item)
s.go:spawn('teleportation_effect')
end
end
end
_____