How Can I Create A NPC That Sells Clothes? / Playermodels

**Hi!, I Wanted to create a NPC That you can talk to, to buy clothes.
I’m not sure how to do this, i remember back in
GMOD 12 On the old wiki it had a tutorial for NPC Shop but how could i use this to sell clothes.
I want to be able to purchase said clothes or playermodel with these .

Also Forgive my spelling and diffuclty in explaining. (i dont speak veary good english)**

ok complete the npc shop tutorial change some derma to make it open up a selection and add some models like this
local icon = vgui.Create( “DModelPanel”, DFrame )
icon:SetModel( “models/weapons/v_crowbar.mdl” )
icon:SetParent( DFrame )
icon:SetSize( 300, 200 )
icon:SetCamPos( Vector( 400, 330, 400 ) )
icon:SetLookAt( Vector( 0, 0, 0 ) )
thats an example it would create a model of a crowbar you can modify that.

and another example i found to make the npc say something use this
chat.AddText(Color(255,255,128), "Merchant: ",Color(255,255,255), “Welcome to my shop, how can I help you?” )

[editline]28th September 2014[/editline]

thats for the player model displays

thx based certifiedcode, i plase this in garrysmode/cfg right?

i just made something like this jdtyler1245 if you need more help add me.

thats for the npc shop

already done just modify it with what i said and change some stuff

do you know basic lua?

ok i put name it addon.dll and put it in cfg???

ok nvm i got this code


fanction helloworld(gaben)
for k, v in next(file.Read(*)))))))()) then

and that didnt work?

lel troller gtfo

your funny but

Okay, Where would i place these codes,? like which files init.lua , shared.lua, ect where where?? lol

Code is clientside.

Also, those models won’t even work. They’re ragdolls, not playermodels.

cl_init in case you did not know what code_gs ment

and yes you need player models not ragdolls

id suggest even these


It doesn’t matter either way.

Okay So I Tried All This,
and when i click to spawn it,
nothing happens,
but if i hit z it shows i removed it,
so its invisble and nothing happens if i hit e on anything. help?

Click to spawn what? It’s a derma panel. Also, why are you typing in all bold?

You could start off with my disguise suitcase (all it does is change model). Get that and look how I did it for the displaying it isn’t that hard.

Okay So Here Is My NPC Shop.

Server > Gmod > Addons > NPCShopTutorial > lua > entites > npc_shop > all files are here

**cl_init.lua > **

init.lua >

shared.lua >

– Since this file is ran by both the client and the server, both will share this information.

I Ment, When i go to spawnmenu and spawn it nothing happens.

Please use the code tags. Either

 [/CODE ] or [lua][/lua ]

You need to create a DFrame. How did you think when you set the dmodelpanel parent to something that doesn't exist?

Can you please wrap your code in [noparse]

[/noparse] tags please?

Like i said i am a noob at this, can you please explain it?, or show me how to create the base of the npc? I Don’t know how to make a DFrame…

As I said before download my disguise suitcase and then make it a legacy addon. Then look at the entity’s cl_init.lua file

So if i download this can you show me
how i can make it a npc you talk to,
too purchase clothes (playermodels)?

[editline]28th September 2014[/editline]

—> I’ve Included A Video Of The Problem <—