[HELP] player spawn skin save


#1

Hello how to configure these changes just at the first spawn? I would like him to keep the changes he made in the store.

AddEventHandler("playerSpawned", function(spawn)
	Citizen.CreateThread(function()
	local playerPed = GetPlayerPed(-1)
	--SET_PED_COMPONENT_VARIATION(Ped ped, int componentId, int drawableId, int textureId, int paletteId)
 SetPedComponentVariation(playerPed, 0, 0, 0, 2) --Face
 SetPedComponentVariation(playerPed, 2, 0, 0, 2) --Hair 
 SetPedComponentVariation(playerPed, 4, 15, 14, 2) -- Pantalon
 SetPedComponentVariation(playerPed, 6, 16, 11, 2) -- Shoes
 SetPedComponentVariation(playerPed, 11, 0, 0, 2) -- Jacket

end)
end)


#2

try this

local firstSpawn = false
AddEventHandler("playerSpawned", function(spawn)
	if not(firstSpawn)then
		Citizen.CreateThread(function()
			local playerPed = GetPlayerPed(-1)
		 	SetPedComponentVariation(playerPed, 0, 0, 0, 2) --Face
		 	SetPedComponentVariation(playerPed, 2, 0, 0, 2) --Hair 
		 	SetPedComponentVariation(playerPed, 4, 15, 14, 2) -- Pantalon
		 	SetPedComponentVariation(playerPed, 6, 16, 11, 2) -- Shoes
		 	SetPedComponentVariation(playerPed, 11, 0, 0, 2) -- Jacket
		end)
		firstSpawn = true
	end
end)

#3

I have a problem I use es_customization (with es_freeroam) but the changes do not save to the death or spawn of the player can you help me?


#4

Where do i put this?


#5

This topic was automatically closed 29 days after the last reply. New replies are no longer allowed.