Thread Tools Display Modes
Prev Previous Post   Next Post Next
06-17-19, 11:19 PM   #1
johnka
A Defias Bandit
Join Date: Jun 2019
Posts: 2
Help wanted from a beginner (interacting with npc and run a command?)

Hello guys, first of all I really don't know much about coding in general and trying to learn the very basics right now, but i had a question about whatever this very small project i have in mind would work or not.

So what i want to do is create a script that runs the command </cancelform> when i right click a friendly NPC, this would be useful for druids in the upcoming wow classic as you can't talk to NPCs in animalforms.

So i would need some api/code that does something when i rightclick an NPC, and well therefor i want to ask if it is at all possible!

Just posting my very limited "psuedo" code, probbably more confusing then helpful but here it is:

if (UnitPlayerControlled("target")) then
{
//DO NOTHING
}

else if (IS UNIT TARGET NPC UNFRIENDLY?)
{
//DO NOTHING
}

else
{
/cancelform
}
end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Help wanted from a beginner (interacting with npc and run a command?)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off