Its an important information.JohnWordsworth wrote:Great to have you on board jKos! I have already added your framework to the ORRR3 (I hope you don't mind!) and can't wait to see what room you come up with.
Code: Select all
function manage_positions(entity,x,y,z)
local ent = findEntity(entity)
if ent then
local face = ent.facing
local pos = ent:getWorldPosition()
if face == 1 or face == 3 then x, z = z, x end
if face == 2 or face == 3 then x, z = -x, -z end
ent:setWorldPosition(pos.x+x,pos.y+y,pos.z+z,0)
local surf = ent.surface
if surf and surf:count()>0 then
for _,i in surf:contents() do
local itemPos = i.go:getWorldPosition()
i.go:setWorldPosition(itemPos.x+x,itemPos.y+y,itemPos.z+z,0)
end
end
end
end