daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Nov 2nd, 2018 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. minetest.register_node("luxury_decor:luxury_wooden_chair_with_cushion", {
  2.     description = "Luxury Wooden Chair (with cushion)",
  3.     visual_scale = 0.5,
  4.     mesh = "luxury_wooden_chair_with_cushion.obj",
  5.     tiles = {"luxury_wooden_chair_with_cushion.png"},
  6.     paramtype = "light",
  7.     paramtype2 = "facedir",
  8.     groups = {snappy = 1.2},
  9.     drawtype = "mesh",
  10.     collision_box = {
  11.         type = "fixed",
  12.         fixed = {
  13.             {-0.3, -0.5, -0.25, 0.45, 0.22, 0.38},
  14.             {-0.3, -0.5, 0.38, 0.45, 1, 0.48}
  15.             --[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
  16.             {-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
  17.         }
  18.     },
  19.     selection_box = {
  20.         type = "fixed",
  21.         fixed = {
  22.             {-0.3, -0.5, -0.25, 0.45, 0.22, 0.38},
  23.             {-0.3, -0.5, 0.38, 0.45, 1, 0.48}
  24.         }
  25.     },
  26.     sounds = default.node_sound_wood_defaults(),
  27.     on_right_click = function (pos, node, clicker, itemstack, pointed_thing)
  28.         local meta = clicker:get_meta()
  29.         local is_attached_to = minetest.deserialize(meta:get_string("attached_to"))
  30.         if is_attached_to == nil or is_attached_to == "" then
  31.            chairs.sit_player(clicker, {pos, node.name, node.param1, node.param2}, {x=pos.x, y=pos.y+0.4, z=pos.z}, {x=81, y=81})
  32.            
  33.         elseif clicker:get_player_name() ~= is_attached_to[3] and is_attached_to ~= nil then
  34.             minetest.chat_send_player(clicker:get_player_name(), "This bed is already busy!")
  35.         elseif clicker:get_player_name() == is_attached_to[3] and pos == is_attached_to[1][1] and minetest.get_node(pos).name == is_attached_to[1][2] then
  36.             chairs.standup_player(clicker)
  37.         end
  38.        
  39.         --[[if minetest.get_node(pos).name ~= node.name then
  40.             is_chair_busy_by = nil
  41.             clicker:set_physics_override({speed=1.0})
  42.             default.player_set_animation(clicker, "stand", 30)
  43.         end]]
  44.            
  45.     end
  46. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top