sit.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. function homedecor.sit(pos, node, clicker)
  2. return -- delete it when the engine is stabler for the player's physics
  3. --[[
  4. local meta = minetest.get_meta(pos)
  5. local param2 = node.param2
  6. local name = clicker:get_player_name()
  7. if name == meta:get_string("is_sit") then
  8. meta:set_string("is_sit", "")
  9. pos.y = pos.y-0.5
  10. clicker:setpos(pos)
  11. clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
  12. clicker:set_physics_override(1, 1, 1)
  13. default.player_attached[name] = false
  14. default.player_set_animation(clicker, "stand", 30)
  15. else
  16. meta:set_string("is_sit", clicker:get_player_name())
  17. clicker:set_eye_offset({x=0,y=-7,z=2}, {x=0,y=0,z=0})
  18. clicker:set_physics_override(0, 0, 0)
  19. clicker:setpos(pos)
  20. default.player_attached[name] = true
  21. default.player_set_animation(clicker, "sit", 30)
  22. if param2 == 0 then
  23. clicker:set_look_yaw(3.15)
  24. elseif param2 == 1 then
  25. clicker:set_look_yaw(7.9)
  26. elseif param2 == 2 then
  27. clicker:set_look_yaw(6.28)
  28. elseif param2 == 3 then
  29. clicker:set_look_yaw(4.75)
  30. else return end
  31. end
  32. --]]
  33. end