Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MorphModule = {}
- local morphs = {
- ["exampleMorph"] = {
- shirt = nil, -- path to shirt
- pants = nil, -- Path to pants
- helm = nil -- Path to helm
- },
- ["anotherExampleMorph"] = {
- shirt = nil,
- pants = nil,
- helm = nil
- }
- }
- local function equipClothes(character, morphInfo)
- -- remove old clothes and equip new ones via morphInfo.shirt, morphInfo.pants
- print("equip clothes")
- end
- local function equipHelm(character, morphInfo)
- -- equip helm here
- print("equip helm")
- end
- function MorphModule:equipMorph(character, morphName)
- local morphInfo = morphs[morphName] -- gets the morph from morph table
- if character and morphName then
- equipClothes(character, morphInfo)
- equipHelm(character, morphInfo)
- end
- end
- return MorphModule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement