Guest User

Untitled

a guest
Jul 8th, 2019
2,498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local abilities = {
  2.     ban_hammer = {
  3.         name = "Ban hammer",
  4.         func = function() print("Banning...") end,
  5.         image = "path to image"
  6.     },
  7.    
  8.     another_ability = {
  9.         name = "Another ability",
  10.         func = function() print("Something else") end,
  11.         image = "path to another image"
  12.     }  
  13. }
  14.  
  15. local characters = {
  16.     builderman = {
  17.         name = "Builderman",
  18.         abilities = {abilities.ban_hammer, abilities.another_ability}
  19.  
  20.     },
  21.    
  22.     shedletsky = {
  23.         name = "Shedletsky",
  24.         abilities = {abilities.another_ability}
  25.     }
  26. }
  27.  
  28.  
  29. -- import the above from some external module, then you could do something like...
  30.    
  31.  
  32. local currentCharacter = "builderman"
  33.  
  34. characters[currentCharacter].abilities[1].func() -- will call banhammer's function
Advertisement
Add Comment
Please, Sign In to add comment