wishful/mods/wisgame/open/open_skin.lua
2025-02-07 14:39:37 -05:00

26 lines
873 B
Lua

-- Define player sikin
local frontTexture = "player.png"
local backTexture = "player_back.png"
-- Number of required textures depends on visual.
-- "sprite" uses 1 texture.
-- "upright_sprite" uses 2 textures: {front, back}.
-- set the player's skin when they join
minetest.register_on_joinplayer(function(player)
player:set_properties({
visual = "upright_sprite",
spritediv = {x = 1, y = 1}, -- declare as a single texture divided into 1x1 sections
initial_sprite_basepos = {x = 0, y = 0}, -- Start at the top-left corner
visual_size = {x = 1, y = 1},
--Thanks to wwwq for fixing this part for me! 0/
eye_height = 0.85,
textures = { frontTexture, backTexture },
visual_size = {x = 1, y = 1, z = 1},
collisionbox = { -0.3, 0, -0.3, 0.3, 0.9, 0.3 },
selectionbox = { -0.5, 0, -0.5, 0.5, 1, 0.5, rotate = false },
});
end)