Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Points System
- local pChar = {10,0,11}
- local ksc = {0,5,10,14,15}
- local dsc = {10,6,5,3,1}
- local asc = {1,6,10,15,16}
- function score()
- local sc = 0
- if pChar[1] <= 4 then
- sc = sc + 1
- elseif pChar[1] > 5 and pChar[1] < 10 then
- sc = sc + 2
- elseif pChar[1] > 10 and pChar[1] < 14 then
- sc = sc + 3
- elseif pChar[1] > 14 then
- sc = sc + 4
- end
- return sc
- end
- function score(val,tScoring, ineq,start)
- local sc = start
- if ineq == "up" then
- for i=1,#tScoring do
- if i <= #tScoring then
- if val >= tScoring[i] then
- sc = sc + 1
- end
- end
- end
- elseif ineq == "down" then
- for i=1,#tScoring do
- if i <= #tScoring then
- if val <= tScoring[i] then
- sc = sc + 1
- end
- end
- end
- end
- return sc
- end
- print(score(pChar[1],ksc,"up",0))
- print(score(pChar[2],dsc,"down",-1))
- print(score(pChar[3],asc,"up",0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement