Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. test2 = {
  2.   collisionbox = { 0, 0, 0, 0, 0, 0 },
  3.   visual = "cube"
  4. }
  5.  
  6. minetest.register_entity("default:test2", test2)
  7.  
  8.  
  9. function attachments()
  10.     prop = {
  11.         mesh = "player.x",
  12.         textures = {"player.png", },
  13.         colors = {{255, 255, 255, 255}, },
  14.         visual = "mesh",
  15.         visual_size = {x=1, y=1},
  16.     }
  17.  
  18.     local pos={x=0,y=0,z=0}
  19.     local newobject=minetest.env:add_entity(pos, "default:test2")
  20.     newobject:set_properties(prop)
  21.     newobject:set_animations({x=1, y=50}, 35, 0)
  22.  
  23.     for _, obj in pairs(minetest.get_connected_players()) do
  24.         if(obj:get_player_name() == "some_nick") then
  25.             newobject:set_attachment(obj, "Bone", {x=0,y=0,z=0}, {x=0,y=0,z=0})
  26.             print ("Attached test object to "..obj:get_player_name())
  27.         end
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement