Jump to content

error sistema de avatares no acutaliza la imagen


BossyXD

Recommended Posts

ise este pequeño sistema de avatares pero cuando lo inicio si saca la imagen del skin pero cuando cambio de skin no se cambia osea no se actualiza la imagen hay una forma de arreglarlo aqui el script pequeño

addEventHandler("onClientResourceStart", resourceRoot,

function()

local skinid = getElementModel(localPlayer)

avatar.skin = guiCreateStaticImage(scx-95-15, 7, 110, 80, "skins/"..getElementModel(localPlayer)..".png", false)

end

)

Link to comment
ise este pequeño sistema de avatares pero cuando lo inicio si saca la imagen del skin pero cuando cambio de skin no se cambia osea no se actualiza la imagen hay una forma de arreglarlo aqui el script pequeño

addEventHandler("onClientResourceStart", resourceRoot,

function()

local skinid = getElementModel(localPlayer)

avatar.skin = guiCreateStaticImage(scx-95-15, 7, 110, 80, "skins/"..getElementModel(localPlayer)..".png", false)

end

)

First of all this subforum is eng only,please translate/repost in the right section

Second:

getElementModel 

returns a number and you need a string

Replace

avatar.skin = guiCreateStaticImage(scx-95-15, 7, 110, 80, "skins/"..getElementModel(localPlayer)..".png", false) 

with this one:

avatar.skin = guiCreateStaticImage(scx-95-15, 7, 110, 80, "skins/"..tostring(getElementModel(localPlayer))..".png", false) 

You should change the event because when the resource is downloaded you might not be spawned

Replace the event with this one

"onClientPlayerSpawn" 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...