
Toggle shoutbox Lastest Announcements
![]() |
Lua Npc Facing Target
#1
Posted 22 September 2010 - 02:50 AM

#3
Posted 22 September 2010 - 06:48 AM
iEzri, on 22 September 2010 - 06:43 AM, said:
I tried using this but I am not sure how to get the proper orientation, which is the way the npc is looking right?
#4
Posted 23 September 2010 - 05:36 AM

#5
Posted 23 September 2010 - 11:26 AM
oriental = math.abs(plr:GetO()-180); unit:MoveTo(plr:GetX(), plr:GetY(), plr:GetZ(), oriental)
do we even have the math library included?
aw i don't know, this is already too l33t for me


#7
Posted 23 September 2010 - 11:45 AM
Foereaper, on 23 September 2010 - 11:32 AM, said:
oriental = math.abs(plr:GetO()+5);?
lol ok its just guessing.. maybe you should play with it for a while ?

#9
Posted 23 September 2010 - 02:06 PM
Foereaper, on 23 September 2010 - 01:28 PM, said:

so is the math library in there ?

#10
Posted 23 September 2010 - 02:22 PM
#11
Posted 23 September 2010 - 03:40 PM
Foereaper, on 23 September 2010 - 02:22 PM, said:
I will give it a try, only problem is if you add 5 but your orientation is already above 5 then you exceed the 1 - 10 but some simply checks could solve that issue.
Wondering if there was a lua function that made the NPC turn and look at you, it seems that the core can do this because when you talk to a npc it turns and looks at you.
Maybe its a modification that I can make to add this ability to the lua engine :s, Some guidance is always welcome.
Thanks everyone for your help so far!
#13
Posted 23 September 2010 - 04:56 PM
Foereaper, on 23 September 2010 - 03:44 PM, said:
aww, i knew it!
lua fangirl ++



#14
Posted 24 September 2010 - 11:11 AM
Wil, on 23 September 2010 - 03:40 PM, said:
Wondering if there was a lua function that made the NPC turn and look at you, it seems that the core can do this because when you talk to a npc it turns and looks at you.
Maybe its a modification that I can make to add this ability to the lua engine :s, Some guidance is always welcome.
Thanks everyone for your help so far!
I think that's handled by the client since when multiple players are talking to the same NPC all the players will have the NPC facing them.