Ginsutime

Untitled

Mar 13th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. nut.command.add("survival", {
  2. onRun = function(client, arguments)
  3. local char = client:getChar()
  4. if(char:getAttrib("wisdom") >= 10) then
  5. local rolled = (math.random(1, 20) + (math.Truncate((char:getAttrib("wisdom") - 10) / 2)))
  6. nut.log.add(client:Name().." rolled \""..rolled.."\"")
  7. nut.chat.send(client, "survival", rolled)
  8. end
  9. if(char:getAttrib("wisdom") == 2 or 4 or 6 or 8) then
  10. local rolled = 90 * (math.random(1, 20) + (math.Round((char:getAttrib("wisdom") - 10) / 2)))
  11. nut.log.add(client:Name().." rolled \""..rolled.."\"")
  12. nut.chat.send(client, "survival", rolled)
  13. elseif(char:getAttrib("wisdom") == 1 or 3 or 5 or 7 or 9) then
  14. local rolled = -100 + (math.random(1, 20) + (math.Round((char:getAttrib("wisdom") - 10) / 2)))
  15. nut.log.add(client:Name().." rolled \""..rolled.."\"")
  16. nut.chat.send(client, "survival", rolled)
  17. end
  18. end
  19. })
  20.  
  21. -- The first if statement of >= 10 works, but the if always takes priority over the elseif even if wisdom is == to an odd #
Add Comment
Please, Sign In to add comment