Need help with a /lspd script

Hi I have started making a script which gives you the lspd skin but not sure how to activate it if someone could help me then great.

server.lua

AddEventHandler('chatMessage', function(source, name, message)
	command = string.lower( command )
	if(command[1] == "/lspd") then
		CancelEvent()
		TriggerClientEvent('changeskin', source)
	end
end)

CLIENT.LUA

RegisterNetEvent("changeskin")
AddEventHandler("changeskin", function()
	cancelEvent()
	SetPlayerModel(player player,  s_m_y_cop_01)
end)

What did you message?

Try this and let me know if it doesn’t work.

Change this:

To this:

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

It should work.

It dont work because i need to know what the code for this is something like setplayermode(player player, s_m_y_cop_01)

Ah alright well if you told me that in your first message that would’ve been nice, but anyway here’s the code for that:

SetPlayerModel(PlayerId(), GetHashKey("s_m_y_cop_01"))

Oh ok thanks any chance your interested in helping out a community

I’m already helping communities by doing things like this. I won’t be a private “helper” if that’s what you’re asking.

1 Like

Ok thats fine but do you know any one that will?

I suggest looking for developers in the #server-development:server-bazaar section, should be a couple there looking for work.

Ok thanks ill try that

Here is the client side code

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

here is the server side code it still dont work

AddEventHandler('chatMessage', function(source, name, message)
	command = string.lower( command )
	if(command[1] == "/lspd") then
		CancelEvent()
		TriggerClientEvent('changeskin', source)
	end
end)

Read this please, I said this because your first method had an error and the method I provided is a lot cleaner.

Ill try it again but idk

It crashed me for some odd reason

Show me what you’ve got inside your files and What’s the error/crash message?

1 sec ill have a look

Alright what’s in your server file and your client file?

Every time i type /lspd but with my code it just does nothing no error no crash