I’m attempting to use a block of script I’ve put together to use /skin blue or such, to change to a set skin. The only issue I am having is when I go to run the command, it doesn’t change my skin. I’ve verified that the skin itself works, but not the command.
Server:
-- Skin
TriggerEvent('es:addGroupCommand', 'skin', "admin", function(source, args, user)
TriggerClientEvent('es_admin:setSkin', source, args[2])
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
Client:
RegisterNetEvent('es_admin:setSkin')
AddEventHandler('es_admin:setSkin', function(v)
if v == "blue" then
if DoesEntityExist(GetPlayerPed(-1)) then
local model = GetHashKey("csb_prolsec")
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
end
end
end)
I’ve tried local model = GetHashKey(“csb_prolsec”) with the "s and without the "s