-
-
Save Bradshaw/6489560 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Files are like functions in lua, except they're only meant to be calles once so you're better off doing what I suggested in my gist | |
local health = 100 -- This is local to the whole file | |
-- class wasn't useful | |
function getHealth() | |
return health -- This returns the value, so health is closed to the file, but can be "read" with this function | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment