Offical forum of LASP, a project to script all the areas in wow via LUA
HomeHome  ­FAQFAQ  ­SearchSearch  ­MemberlistMemberlist  ­UsergroupsUsergroups  ­Donate!  ­RegisterRegister  ­Log inLog in  
Post new topic   Reply to topicShare | 
 

 Local plr?

View previous topic View next topic Go down 
AuthorMessage
[Cloud]
New guy


Posts: 2
Join date: 2008-07-01

PostSubject: Local plr?   Tue Jul 01, 2008 3:45 pm

Will since I started LUA not too long ago I have not seen this command yet:

Code:
local plr = pUnit:GetClosestPlayer()
if (plr ~= nil) then


Would anyone like to clarify what it is for me?
Back to top Go down
View user profile
mager1794
New guy


Posts: 3
Join date: 2008-07-03

PostSubject: Re: Local plr?   Thu Jul 03, 2008 12:12 am

local plr = pUnit:GetClosestPlayer()

is declaring that the simple word
plr
will get the closest player

if (plr ~= nil) then
is making sure it has a player before it does anything
Back to top Go down
View user profile
Ramor
New guy


Posts: 6
Join date: 2008-04-29
Age: 19
Location: NC, USA

PostSubject: Re: Local plr?   Tue Jul 08, 2008 10:43 am

Late post, but you might want to keep in mind that when you use functions such as CastSpell, CastSpellOnTarget, FullCastSpell, and FullCastSpellOTarget, they all cast the spells on the NPC using the spell, so you need to define what the target is before it starts casting. That's where this would come in to play.
Back to top Go down
View user profile http://autumn-insomnia.com/
 

Local plr?

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You cannot reply to topics in this forum
LUA Area Scripting Project :: General :: Support! If you want to ask anything, do it here-
Post new topic   Reply to topic