This commit is contained in:
Zughy 2022-01-12 01:22:10 +01:00
parent 5d2834eb1f
commit 556cacf038
2 changed files with 4 additions and 4 deletions

View File

@ -466,7 +466,7 @@ The player API can register player models and update the player's appearance.
* Sets a player texture
* `player`: PlayerRef
* `texture`: texture filename
* `texture_ID`: the ID of the texture to change. If nil, default is `1`
* `index`: the index of the texture to change. If nil, default is `1`
* `player_api.get_animation(player)`
* Returns a table containing fields `model`, `textures` and `animation`

View File

@ -71,10 +71,10 @@ function player_api.set_textures(player, textures)
player:set_properties({textures = textures or model_textures})
end
function player_api.set_texture(player, texture, texture_ID)
local ID = not texture_ID and 1 or texture_ID
function player_api.set_texture(player, texture, index)
local new_textures = player:get_properties().textures
new_textures[ID] = texture
index = index or 1
new_textures[index] = texture
player:set_properties({textures = new_textures})
end