View Single Post
12-15-13, 05:22 PM   #2
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Lua Code:
  1. local function IAmStill()
  2.     local currentSpeed = GetUnitSpeed("player")
  3.  
  4.     if (currentSpeed == 0) then
  5.         return true
  6.     else
  7.         return false
  8.     end
  9. end
  10.  
  11. IAm = {
  12.     still = IAmStill
  13. }

1) "Player" isn't a valid UnitID, "player" is.
2) Make IAmStill local.
3) IAm.still needs to be a function reference, not the return of a function (denoted by ()).
4) I don't condone making IAm global, nor do I condone the way you are calling the function, but I am hoping that it is a crude test and that you intend to localize the table and call it in a better way.

/run print(IAm.still()) should work.

Last edited by Clamsoda : 12-15-13 at 05:25 PM.
  Reply With Quote