• Shop SNPC ENT:Use help
    6 replies, posted
With my shop SNPC, I can't seem to get it working with ENT:Use to open my derma menu. I put the menu code in cl_init and then put ENT:Use code to run the derma menu in init? I'm a beginner with any kind of ENT
You'll need to use [b][url=wiki.garrysmod.com/?title=ENT.AcceptInput]ENT.AcceptInput [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]. Check the name argument for being "use", then do self:Use(activator, caller).
Garrysmod.com isn't working for me, IE I get internal/server error and on Firefox I get Your PHP installation appears to be missing the MySQL extension which is required by WordPress. So how long will the site be down? EDIT: would the code be like this? [code] function Shop() DermaFrame = vgui.Create( "DFrame" ) DermaFrame:SetPos( 50, 50 ) DermaFrame:SetSize( 500, 350 ) DermaFrame:SetTitle( "Hello" ) DermaFrame:SetVisible( true ) DermaFrame:SetDraggable( true ) DermaFrame:ShowCloseButton( true ) DermaFrame:MakePopup() concommand.Remove("Shop") end concommand.Add( "Shop", Shop ) function ENT:AcceptInput( input, activator, caller ) if input == "Use" and activator:IsPlayer() and activator:KeyPressed( 32 ) then RunConsoleCommand("Shop") end end [/code]
No. You need that ENT:AcceptInput() function in the init.lua file of the SNPC.
Yeah, but then it would work?
Why else would I help you with the problem if I didn't think what I was telling you would work?
I was just asking, to make sure I didn't have to do anything else. Also, thank you for the help, just got it functioning.
Sorry, you need to Log In to post a reply to this thread.