Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local abilities = {
- ban_hammer = {
- name = "Ban hammer",
- func = function() print("Banning...") end,
- image = "path to image"
- },
- another_ability = {
- name = "Another ability",
- func = function() print("Something else") end,
- image = "path to another image"
- }
- }
- local characters = {
- builderman = {
- name = "Builderman",
- abilities = {abilities.ban_hammer, abilities.another_ability}
- },
- shedletsky = {
- name = "Shedletsky",
- abilities = {abilities.another_ability}
- }
- }
- -- import the above from some external module, then you could do something like...
- local currentCharacter = "builderman"
- characters[currentCharacter].abilities[1].func() -- will call banhammer's function
Advertisement
Add Comment
Please, Sign In to add comment