ID:322207
 
(See the best response by Neimo.)
obj/NPCs
density = 1
layer=MOB_LAYER
New()
src.AddName()
return ..()
Indian
icon='NPCs.dmi'
icon_state = "Chief"
name = "Chief"
Click()
set category=null
set src in oview()
winset(src,"MainWindow.DefaultInput","is-visible=true")


Hello.I want to make that when player click on Npc he will open winset.But I just made error by trying it.Ty for any help
Best response
You are using the wrong argument for the reference in winset().

winset(usr,"MainWindow.DefaultInput","is-visible=true")
Omg lol yea. Ty :)
Slightly nitpicky (or more so), but I think you might as well use winshow() here if that's all you're doing. If you're going to be modifying multiple parameters on the same control, that would be good in a single winset(). If not, you might as well use winshow().

edit: Also, Click() doesn't work like a normal verb where you use verb settings. If you want to restrict it like that, you need to use an if() instead. And, clicks also don't show up in verb panels, so the category setting is even more unnecessary.
Click()
if(src in oview())
// ...
..()
In response to LaNuiit (#2)
Oh, and you should also add ..() onto your modified Click() procedure so it doesn't override any other instance of Click() pertaining to objs.