opnaiC Posted September 1, 2016 Share Posted September 1, 2016 local skins = { 73,287,312,179,61 } function skin () local thePlayer = client local playeraccount = getPlayerAccount ( thePlayer ) local fac = getAccountData(playeraccount,"Faction") or 0 local rank = getAccountData(playeraccount,"Rank") or 0 if thePlayer and isElement(thePlayer) then local model = getElementModel (thePlayer) if (tonumber( fac) == 8 ) then if not skins[model] then -- something should be wrong here setAccountData(playeraccount, "SkinBeforeJob", tonumber(model)) if (tonumber(rank) == 1) then setElementModel(thePlayer,73) elseif (tonumber(rank) == 2) then setElementModel(thePlayer,287) elseif (tonumber(rank) == 3) then setElementModel(thePlayer,287) elseif (tonumber(rank) == 4) then setElementModel(thePlayer,312) elseif (tonumber(rank) == 5) then setElementModel(thePlayer,179) elseif (tonumber(rank) == 6) then setElementModel(thePlayer,61) end else local oldskin = getAccountData(playeraccount, "SkinBeforeJob") or 0 setElementModel (thePlayer, tonumber(oldskin)) end end end end addEvent ("skinL", true) addEventHandler ("skinL", root, skin) It is setting the model to the new one but not to the old. Nothing in debug Link to comment
Captain Cody Posted September 1, 2016 Share Posted September 1, 2016 local skins = { [73]= true,[287]= true,[312]= true,[179]= true,[61]= true } 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