Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon_text = {
- text = "Text";
- tColour = "black";
- bColour = "white";
- }
- function mon_text:new(name)
- local object = {}
- object.name = name
- setmetatable( object, { __index = self })
- return object
- end
- function mon_text:setRule(rule, value)
- self[rule] = value
- end
- function mon_text:ruleExists(rule)
- for k, v in pairs(self) do
- if k == rule then
- return true
- end
- end
- return false
- end
- function mon_text:getRule(rule)
- if self:ruleExists(rule) == true then
- return self[rule]
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment