Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test2 = {
- collisionbox = { 0, 0, 0, 0, 0, 0 },
- visual = "cube"
- }
- minetest.register_entity("default:test2", test2)
- function attachments()
- prop = {
- mesh = "player.x",
- textures = {"player.png", },
- colors = {{255, 255, 255, 255}, },
- visual = "mesh",
- visual_size = {x=1, y=1},
- }
- local pos={x=0,y=0,z=0}
- local newobject=minetest.env:add_entity(pos, "default:test2")
- newobject:set_properties(prop)
- newobject:set_animations({x=1, y=50}, 35, 0)
- for _, obj in pairs(minetest.get_connected_players()) do
- if(obj:get_player_name() == "some_nick") then
- newobject:set_attachment(obj, "Bone", {x=0,y=0,z=0}, {x=0,y=0,z=0})
- print ("Attached test object to "..obj:get_player_name())
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement