[LUA HELP] DarkRP Config - How to set Money Model's skin?

Hi there!

On my DarkRP server, I have set the GM.Config.moneyModel in the settings.lua to a realistic British Pound Note model. However, the model has 4 different skins for the £5, £10, £20 and £50 notes. Currently, it uses the default skin, which is the £5 note. But I want to set it so that it uses the £10 note skin.

I know the function for setting an entity’s model skin is Entity:SetSkin, but is there any way of accomplishing this that would not require me to create my own Money entitity?

Many thanks in advance.

Hook into OnEntityCreated and check if it’s the money entity. Then set the skin accordingly.

You can modify this and it should do what you want.



local function ChangeMoneyLook( ent )
   if ( ent:GetClass() == "name of entity goes here" ) then
      ent:SetSkin( skinIndex number goes here )
   end
end
hook.Add( "OnEntityCreated", "ChangeMoneyLook", ChangeMoneyLook )


:snip: