Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. function Player:sendAttributeModal()
  2. local points = self:getAttributePoints()
  3. local modaltext = "Available points: [" .. points .. "]\n\nAttribute Modifier Current "
  4. local AttributeWindow = ModalWindow(666, "Attribute points", modaltext)
  5. AttributeWindow:addButton(1, "Assign")
  6. AttributeWindow:setDefaultEnterButton(1)
  7. AttributeWindow:addButton(2, "Exit")
  8. AttributeWindow:setDefaultEscapeButton(2)
  9. for id, name in ipairs(ATTRIBUTE_NAMES) do
  10. local current = self:getAttributeLevel(id)*ATTRIBUTE_MODIFIERS[id]
  11. local choicetext = "[" .. name .. "]" .. (" "):rep(ATTRIBUTE_SPACING[id][1]+2) .. "[+%" .. ATTRIBUTE_MODIFIERS[id] .. "]"
  12. choicetext = choicetext .. (" "):rep(ATTRIBUTE_SPACING[id][2]+3) .. "[+%" .. current .. "]"
  13. AttributeWindow:addChoice(id, choicetext)
  14. end
  15. AttributeWindow:sendToPlayer(self)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement