Models are changing on death

Hello,

I’m starting my own server and I’m having a very confusing problem.
Whenever I choose a job and a model, I will sometimes get a different model from that job. Also when I die, my model will change again.
How do I fix it that you will always keep the model you chose, even if you died.

Thanks for the help!

are you using an admin mod that changes models? I had that issue many years ago then i switched to ulx.

No just FAdmin and ULX

If your deriving from sandbox, it uses player_manager upon playerinitialspawn and playerspawn hooks. This sets the player model upon spawn to what the player_class is. You will have to set a player class properly with player_manager for it to take effect. Or override the spawn function and do what you want manually without player_manager interfering.

I’m sorry, I’m trying to learn lua but I don’t completely understand what you say. Could you give an example?

If the gamemode is derived from sandbox, then the default player class will set the player’s model to whatever they have saved. If this is a custom gamemode, you need to create a hook to PlayerSpawn, and use SetModel to give the player a model. If the gamemode is DarkRP, then it is another issue.

I think you are using DarkRP, so maybe an addon is interfering? If you message me with connection details, I can try to see what is wrong.

I stand corrected. You should hook PlayerSetModel instead.

Don’t use PlayerSpawn, use PlayerSetModel. It’s for this exact purpose. Remember to return true in it if you change the model so the gamemode doesn’t override it.