LK_lk
1
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)
Vespura
4
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.
LK_lk
5
It dont work because i need to know what the code for this is something like setplayermode(player player, s_m_y_cop_01)
Vespura
6
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"))
LK_lk
7
Oh ok thanks any chance your interested in helping out a community
Vespura
8
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
LK_lk
9
Ok thats fine but do you know any one that will?
Vespura
10
I suggest looking for developers in the #server-development:server-bazaar section, should be a couple there looking for work.
LK_lk
12
Here is the client side code
RegisterNetEvent("changeskin")
AddEventHandler("changeskin", function()
SetPlayerModel(PlayerId(), GetHashKey("s_m_y_cop_01"))
end)
LK_lk
13
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)
Vespura
14
Read this please, I said this because your first method had an error and the method I provided is a lot cleaner.
LK_lk
16
It crashed me for some odd reason
Vespura
17
Show me what youâve got inside your files and Whatâs the error/crash message?
Vespura
20
Alright whatâs in your server file and your client file?
LK_lk
21
Every time i type /lspd but with my code it just does nothing no error no crash