Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nut.command.add("survival", {
- onRun = function(client, arguments)
- local char = client:getChar()
- if(char:getAttrib("wisdom") >= 10) then
- local rolled = (math.random(1, 20) + (math.Truncate((char:getAttrib("wisdom") - 10) / 2)))
- nut.log.add(client:Name().." rolled \""..rolled.."\"")
- nut.chat.send(client, "survival", rolled)
- end
- if(char:getAttrib("wisdom") == 2 or 4 or 6 or 8) then
- local rolled = 90 * (math.random(1, 20) + (math.Round((char:getAttrib("wisdom") - 10) / 2)))
- nut.log.add(client:Name().." rolled \""..rolled.."\"")
- nut.chat.send(client, "survival", rolled)
- elseif(char:getAttrib("wisdom") == 1 or 3 or 5 or 7 or 9) then
- local rolled = -100 + (math.random(1, 20) + (math.Round((char:getAttrib("wisdom") - 10) / 2)))
- nut.log.add(client:Name().." rolled \""..rolled.."\"")
- nut.chat.send(client, "survival", rolled)
- end
- end
- })
- -- 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