ID = 0 globe_pos = {} globe_vel = {} anchor={ physical = false, timer=0, visual_size = {x=0.5, y=0.5}, textures = {"bullet.png"}, lastpos={}, collisionbox = {-0.17,-0.17,-0.17,0.17,0.17,0.17}, set_id = true } anchor.on_step = function(self, dtime) self.timer=self.timer+dtime --print(dump(self.set_id)) if self.set_id == true then self.ID = ID self.set_id = false print(dump(self.ID)) local pos = self.object:getpos() minetest.env:add_entity({x=pos.x,y=pos.y+1,z=pos.z}, "anchor:ballast") end self.object:setvelocity({x=math.random(1,3),y=math.random(1,3),z=math.random(1,3)}) globe_vel[self.ID] = self.object:getvelocity() globe_pos[self.ID] = self.object:getpos() end minetest.register_entity("anchor:anchor", anchor) ballast={ physical = false, timer=0, visual_size = {x=0.5, y=0.5}, textures = {"bullet.png"}, lastpos={}, collisionbox = {-0.17,-0.17,-0.17,0.17,0.17,0.17}, set_id = true } ballast.on_step = function(self, dtime) if self.set_id == true then self.ID = ID self.set_id = false print(dump(self.ID)) end self.object:setvelocity(globe_vel[self.ID]) print(dump(globe_pos[self.ID])) end minetest.register_entity("anchor:ballast", ballast)