TheHavique Posted September 2, 2015 Share Posted September 2, 2015 Im working on a CJ clothes script, to save it, Im using this function: function createClothesJSONString ( returnType ) local clothesTable = {} local smtn = false for i=0,17 do local texture, model = getPedClothes ( localPlayer, i ) if ( texture ) then local theType, theIndex = getTypeIndexFromClothes ( texture, model ) clothesTable[theType] = theIndex smtn = true end end if ( smtn ) then if ( returnType == "JSON" ) then return "" .. toJSON( clothesTable ):gsub( " ", "" ) .. "" else return clothesTable end else return "NULL" end end The output this function gives is this for example: [{"1":25,"2":14,"3":13,"0":0,"13":8,"15":10}] "1" = clothesType :25 = clothesIndex etc. But the problem is, as you can see it outputs, "0":0. This causes shirts not being saved because it always set their shirt to player_torso. Anyone has any idea how I can fix this? 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