WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   SetFormattedText (https://www.wowinterface.com/forums/showthread.php?t=42444)

unlimit 01-24-12 02:54 PM

SetFormattedText
 
lua Code:
  1. text=""
  2. if not unit:IsIncapacitated() then
  3.     if UnitIsDead(uid) then
  4.         text = "Dead";
  5.     elseif UnitIsGhost(uid) then
  6.         text = "Ghost";
  7.     elseif not UnitIsConnected(uid) then
  8.         text = "Link Dead";
  9.     else
  10.         text = format("%0.0f | %s", unit:FracHealth()*100, VFL.Kay(unit:Health()));
  11.     end
  12. else
  13.     text ="";
  14. end

Just won't workkkk, I don't know what to do to get it to show up. c_C

text should return something like (assuming I had 100k health) 85 | 85k, but all it does is throw out errors.

Damn me. D:<

Ailae 01-24-12 03:37 PM

Well, what's the error then?

Chances are you're not getting any values or invalid values (strings when you expect numbers) returned back from your functions.

unlimit 01-24-12 03:38 PM

c.c figured it out, format needs to be string.format.

>_<

Vlad 01-24-12 03:55 PM

format points to string.format and should have worked :(

unlimit 01-24-12 08:14 PM

Quote:

Originally Posted by Vladinator (Post 251492)
format points to string.format and should have worked :(

c.c Yeahhh, but it didn't work until I did string.format. O_o


All times are GMT -6. The time now is 11:20 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI