How do I colorize the player's skin?
-
- Member
- Posts: 315
- Joined: Sun Jun 16, 2019 20:17
- Location: Earth
How do I colorize the player's skin?
I'm thinking about making a mod that colorizes the player's skin. The player's skin texture would stay the same, but it would recoloured. I know how to colorize textures, but I don't know how to get the player's skin texture or set it.
Re: How do I colorize the player's skin?
If you're using the player_api mod you can use get_animation to get the textures for a player and set_textures to modify it. If you're using 3d armors or something else that modifies players visually, this might be different.
I haven't tested this so it might contain mistakes.
Code: Select all
--returns a table with model, textures and animation
local anim = player_api.get_animation(player)
--use a new table because the argument you get is a reference to a table
-- and changing it might mess things up
local modified_textures = {}
for i, t in ipairs(anim.textures) --copy each texture over and append the modifier
do
modified_textures[i] = t .. texture_modifier
end
--set the modified textures
player_api.set_textures(player, modified_textures)
Re: How do I colorize the player's skin?
local skin = player:get_properties().textures
player:set_properties({textures=skin})
try: print(dump(player:get_properties()))
player:set_properties({textures=skin})
try: print(dump(player:get_properties()))
Who is online
Users browsing this forum: Google [Bot] and 2 guests