Hello, I am creating a npc that opens up a derma menu. However I am oblivious of how to get it to actually run the console command on player use. Please help
npc’s cant run console commands afaik…
I think he means he wants the menu to show up on the client when they goto an npc and press use.
Thank you for understanding unlike some idiots… Sort of stated and I quote “ENT:Use”
You need to set the entity’s usetype (Entity:SetUseType(SIMPLE_USE)) to make it usable.
Then, you can use ENT:Use or ENT:AcceptInput and use Player:ConCommand(“command”) to run a console command:
function ENT:Use(activator, caller, usetype, value)
– If the above doesn’t work, try this instead
function ENT:AcceptInput(input, activator, caller)
if (input == “Use” and activator:IsPlayer()) then
In this case, using the entity/NPC will kill the player.
Thank you so much man!