Thread Tools Display Modes
07-16-10, 12:27 AM   #1
MrLulz
A Murloc Raider
 
MrLulz's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 5
If Statement Trouble

So I have this if statement:
Code:
local isBuffed1,_,_,_,_,_,_,isMine1 = UnitAura("Player","Battle Shout");
local isBuffed2,_,_,_,_,_,_,isMine2 = UnitAura("Player","Commanding Shout");
if((isBuffed1 ~= nil and isBuffed2 ~= nil) or isMine1 == "PLAYER" or isMine2 == "PLAYER") then
	bString = bString.."\nTest :O"
else
	bString = bString.."\nShout"
end
It's only half working, and I guess I'm to dumb to notice why. :P

Basically, the problem is that the vars "isMine1" and "isMine2" are giving me trouble. If I go in game, cast a shout on myself, and then print the var it returns "PLAYER". However, in the if statement I can never get either one to return true for isMine1 == "PLAYER"

Anyone notice what I'm doing wrong, cause I'm stumped. =/
  Reply With Quote
07-16-10, 01:18 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
"PLAYER" should be lowercase, "player"
  Reply With Quote
07-16-10, 01:50 AM   #3
MrLulz
A Murloc Raider
 
MrLulz's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 5
Hmm, I had "Player" but then tried all caps since it was printing in all caps but that worked.

Thanks.

Edit: I'm stupid, the font I was using prints in all caps. xD

Last edited by MrLulz : 07-16-10 at 04:30 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » If Statement Trouble


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