Jump to content

Code is not working!


Recommended Posts

Hi.

Here we go, I can't see new texture and also - can't see the output message. What is wrong with this?

Texture file is actually existing in player's resource in models folder.

function loadPlayerTXD() 
    playertxd = engineLoadTXD("models/omyst.txd") 
    engineImportTXD(playertxd, 60) 
    outputChatBox("Player skin loaded!", getRootElement()) 
end 
  
addEventHandler("OnClientResourceStart", getRootElement(), loadPlayerTXD()) -- 

Link to comment

You had 3 mistakes

first one there's no player argument on outputChatBox clientside

the second one is you've "OnClientResourceStart" instead of "onClientResourceStart"

the third one is you used root with "onClientResourceStart" and what this is gonna lead to is everytime you start any script while this script is running "loadPlayerTXD" function will be executed over and over so you have to use resourceRoot instead

resourceRoot = thisResource

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...