Need help with a /lspd script

client

RegisterNetEvent("changeskin")
AddEventHandler("changeskin", function()
    SetPlayerModel(PlayerId(), GetHashKey("s_m_y_cop_01"))
end)

server

RegisterCommand('lspd', function(source)
    TriggerClientEvent('changeskin', source)
end, false)

An even better solution would be to remove your server file completely, and just put this inside your client script:

RegisterCommand("lspd", function()
    SetPlayerModel(PlayerId(), GetHashKey("s_m_y_cop_01"))
end, false)

That works, just tested it.

Ok thanks you want me to mention you if i release the script or not?

If you feel like doing that, then be my guest :wink:

I allways mention people in releasesif its there code unless they dont want me to release it or mention them

just got a crash after typing /lspd

Alright, I just got it too. Worked fine the first time though I’ll have a look.

Ok thanks i think it is the way you did /lspd as its if i ever have the way you coded /lspd is like braking it lol.
Also thanks for taking your time to help me :slight_smile:

woudl it be

CHANGE_PLAYER_PED

instead of set player ped

No because another script also uses SetPlayerModel and it works fine.

ok maybe the way you coded the /lspd part im thinking then

also @sadboilogan showed me a different way to do setplayermodel but he delted his message before i could use it

Nope using registercommand is fine, shouldn’t have any problems.

Ok IDK then because as soon as i put your command in it crashed me

It’s the “s_m_y_cop_01” that’s crashing it. Are you sure that’s the right ped name? I just tried to put “a_m_y_skater_01” in there and it worked fine.

ill double check but yeh

Looks like some peds just bug out for some reason, I’ll experiment with this a bit more and come back to you.

Try S_M_Y_Cop_01

as for female one it is S_F_Y_Cop_01

Nope, no difference: image

Name: Cop01SMY
Hash: 1581098148

https://wiki.■■■■■■■■■■■/index.php?title=Peds