player set textures

From Minetest Developer Wiki
Jump to: navigation, search
Mbox warning.png This page has been proposed for deletion for the following reason: "Outdated"
If you don't think that this page should be deleted, please explain why on the talk page.

This function will be removed in next stable release

Contents

Syntax

default.player_set_textures(player, filename)

Description

Set texture for player.

Parameters

  1. Player object
  2. path to file with texture, ending to .png

Example

player_textures mod

minetest.register_on_joinplayer(function(player)
	local playername = player:get_player_name() -- get player's name
	local filename = minetest.get_modpath("player_textures").."/textures/player_"..playername..".png" -- get path to the player's texture (skin)
	local f = io.open(filename)
	if f then -- if file exists, set a new texture
		f:close()
		default.player_set_textures(player, {"player_"..playername..".png"})
	end
end)

This article needs to be checked

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox