Tex Ranflas Posted March 13, 2016 Share Posted March 13, 2016 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
KariiiM Posted March 13, 2016 Share Posted March 13, 2016 Try that, function loadPlayerTXD() local playertxd = engineLoadTXD("models/omyst.txd") engineImportTXD(playertxd, 60) outputChatBox("Player skin loaded!") end addEventHandler("onClientResourceStart", resourceRoot, loadPlayerTXD) Link to comment
Tex Ranflas Posted March 13, 2016 Author Share Posted March 13, 2016 It works. Does resourceRoot means actually player who got the client resource on its computer? Link to comment
ALw7sH Posted March 13, 2016 Share Posted March 13, 2016 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
KariiiM Posted March 13, 2016 Share Posted March 13, 2016 Basically, resourceRoot = getResourceRootElement(getThisResource()) instead of keep writing all that, resourceRoot is a predifined variable Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now