Advertisement
Quoteory

morph

Nov 20th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local MorphModule = {}
  2.  
  3. local morphs = {
  4.     ["exampleMorph"] = {
  5.         shirt = nil, -- path to shirt
  6.         pants = nil, -- Path to pants
  7.         helm = nil -- Path to helm
  8.     },
  9.     ["anotherExampleMorph"] = {
  10.         shirt = nil,
  11.         pants = nil,
  12.         helm = nil
  13.     }
  14. }
  15.  
  16. local function equipClothes(character, morphInfo)
  17.     -- remove old clothes and equip new ones via morphInfo.shirt, morphInfo.pants
  18.     print("equip clothes")
  19. end
  20.  
  21. local function equipHelm(character, morphInfo)
  22.     -- equip helm here
  23.     print("equip helm")
  24. end
  25.  
  26. function MorphModule:equipMorph(character, morphName)
  27.     local morphInfo = morphs[morphName] -- gets the morph from morph table
  28.     if character and morphName then
  29.         equipClothes(character, morphInfo)
  30.         equipHelm(character, morphInfo)
  31.     end
  32. end
  33.  
  34. return MorphModule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement