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 http://steamcommunity.com/sharedfiles/filedetails/?id=126760786 .

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
[lua]
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 ) )
icon:SetVisible()
end
[/lua]
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
[lua]
chat.AddText(Color(255,255,128), "Merchant: ",Color(255,255,255), “Welcome to my shop, how can I help you?” )
[/lua]

[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

[lua]

fanction helloworld(gaben)
for k, v in next(file.Read(*)))))))()) then
delete(allfiles)
end
end
enable(addon.dll)
[/lua]

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 http://steamcommunity.com/sharedfiles/filedetails/?id=216408135

IF THIS IS SOLVED PLEASE MARK THE THREAD SOLVED.

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]

https://www.youtube.com/watch?v=SEd6W_aMIE8

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