So I was reading this guide: http://howtomakeanrpg.com/a/classes-in-lua.html And it showed off a fancy way of turning a table into a class, but why not just use a script as a class and add all the methods and variables for Orc to that?
name = "Orc"
maxHealth = 10;
currentHealth = maxHealth;
damage = 2;
--------------------------------------------------------------------------------
function TakeDamage(amount)
end
function Attack(mob)
mob.takeDamage();
end
--------------------------------------------------------------------------------
function Start()
end
function Update()
end
--------------------------------------------------------------------------------
Start();
while(wait(1/60))do
Update();
end

3 comments
Keep in mind the built-in wait function allows you to yield the minimum of 1/30th of a second. For draw calls that need to be done before a frame is drawn, use the RenderStepped event. For other update calls use the Stepped or Heartbeat events as they are called after the frame is drawn. All are tied to the machine's framerate, often 1/60th of a second.
Please make use of the conditional portion of the while loop.
Lol, yeah, I tested the Update method with print, and noticed that it was printing way slower than it should have done, but 30 fps is still fine I guess.