DarkStalker30 Posted August 1, 2023 Share Posted August 1, 2023 (edited) So, I trying to change skin for player after registration. Im using setElementModel(client, skin) but it doesn't work. No errors in console or debugscript; "thePlayer", "root" doing errors. setElementData & setPedWalkingStyle working good. How can I change the skin in this way? Edited August 1, 2023 by DarkStalker30 Link to comment
βurak Posted August 2, 2023 Share Posted August 2, 2023 (edited) can you show the code Edited August 2, 2023 by Burak5312 Link to comment
DarkStalker30 Posted August 2, 2023 Author Share Posted August 2, 2023 (edited) 5 hours ago, Burak5312 said: can you show the code setElementData(client, "player.isCharCreator", false)--working good setElementData(client, "player.sex", charTable[4])--working good if charTable[4] then setPedWalkingStyle(client, 118)--working too else setPedWalkingStyle(client, 129)--working too end setElementData(client, "player.skin", charTable[7]) local skin = tonumber(charTable[7]) setElementModel(client, skin)--didn't work Edited August 2, 2023 by DarkStalker30 Link to comment
DarkStalker30 Posted August 2, 2023 Author Share Posted August 2, 2023 (edited) Previous and next codes working good, I'm spawning in dimension 0 on right coords and with normal camera. setElementDimension(client, 0) setElementData(client, "player.isCharCreator", false) setElementData(client, "player.sex", charTable[4]) if charTable[4] then setPedWalkingStyle(client, 118) else setPedWalkingStyle(client, 129) end setElementData(client, "player.skin", charTable[7]) local skin = tonumber(charTable[7]) setElementModel(player, skin) setElementData(client, "player.pame", charTable[8]) setElementData(client, "player.isCharCreator", false) spawnPlayer(client, 233.5927734375, -1278.25, 6.351, -100, 0, 0, 0) fadeCamera(client, true) setCameraTarget(client) From client: triggerServerEvent("endCreate", localPlayer) Edited August 2, 2023 by DarkStalker30 Link to comment
#!_A7M8D Posted August 2, 2023 Share Posted August 2, 2023 (edited) Hello Change setElementModel(player, skin) To setElementModel(client, skin) Cheers! Edited August 2, 2023 by #!_A7M8D Link to comment
βurak Posted August 2, 2023 Share Posted August 2, 2023 setElementData(client, "player.isCharCreator", false)--working good setElementData(client, "player.sex", charTable[4])--working good if charTable[4] then setPedWalkingStyle(client, 118)--working too else setPedWalkingStyle(client, 129)--working too end setElementData(client, "player.skin", charTable[7]) print(charTable[7]) --show me what is charTable[7] local skin = tonumber(charTable[7]) setElementModel(client, skin)--didn't work Can you debug the CharTable[7] data 1 Link to comment
DarkStalker30 Posted August 2, 2023 Author Share Posted August 2, 2023 54 minutes ago, #!_A7M8D said: Hello Change setElementModel(player, skin) To setElementModel(client, skin) Cheers! Already did, no any errors but didnt work. 28 minutes ago, Burak5312 said: setElementData(client, "player.isCharCreator", false)--working good setElementData(client, "player.sex", charTable[4])--working good if charTable[4] then setPedWalkingStyle(client, 118)--working too else setPedWalkingStyle(client, 129)--working too end setElementData(client, "player.skin", charTable[7]) print(charTable[7]) --show me what is charTable[7] local skin = tonumber(charTable[7]) setElementModel(client, skin)--didn't work Can you debug the CharTable[7] data Debug is OK, right number in data. On spawn I have script for setting skin from data "player.skin" and it's working correct. Link to comment
βurak Posted August 2, 2023 Share Posted August 2, 2023 (edited) can you show more code setElementDimension(client, 0) setElementData(client, "player.isCharCreator", false) setElementData(client, "player.sex", charTable[4]) if charTable[4] then setPedWalkingStyle(client, 118) else setPedWalkingStyle(client, 129) end setElementData(client, "player.skin", charTable[7]) local skin = tonumber(charTable[7]) --setElementModel(player, skin) --no need this setElementData(client, "player.pame", charTable[8]) setElementData(client, "player.isCharCreator", false) spawnPlayer(client, 233.5927734375, -1278.25, 6.351, -100, skin, 0, 0) --use spawnPlayer skin parameter fadeCamera(client, true) setCameraTarget(client) by the way, you don't need to use setElementModel, spawnPlayer function has skin parameter for it Edited August 2, 2023 by Burak5312 1 Link to comment
DarkStalker30 Posted August 2, 2023 Author Share Posted August 2, 2023 7 hours ago, Burak5312 said: by the way, you don't need to use setElementModel, spawnPlayer function has skin parameter for it LOL REALLY THANKS! I wrote the code at night and just forgot about that, Im stupid Thx for help everyone. Link to comment
βurak Posted August 3, 2023 Share Posted August 3, 2023 (edited) you're welcome Edited August 3, 2023 by Burak5312 1 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