Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local LowestNumberMax, HighestNumberMax = 1, 100
- local WantedNumber = math.random(LowestNumberMax, HighestNumberMax)
- local Generation,CurrentNumber,CurrentType,GlobalSpieces = 1,0,false,'Idex'
- function Get_RandomNumber(Low, Max)
- local Number = math.random
- return Number(Low, Max)
- end
- function RandomChance()
- local Weight = math.random(1,HighestNumberMax)
- local WantedNumber = math.random(1,HighestNumberMax)
- if Weight > WantedNumber then
- return false else return true
- end
- end
- function SpiecesType(Spieces_Id)
- local Spieces = {
- {1, 'Human'};
- {50, 'Demi Human'};
- {70, 'Furrys'};
- {80, 'Fish'};
- {100, 'Cyborg'};
- }; CurrentSpieces = Spieces[1][2]
- if Spieces_Id >= Spieces[1][1] and Spieces_Id < Spieces[2][1] then
- CurrentSpieces = Spieces[1][2]
- elseif Spieces_Id >= Spieces[2][1] and Spieces_Id < Spieces[3][1] then
- CurrentSpieces = Spieces[2][2]
- elseif Spieces_Id >= Spieces[3][1] and Spieces_Id < Spieces[4][1] then
- CurrentSpieces = Spieces[3][2]
- elseif Spieces_Id >= Spieces[4][1] and Spieces_Id < Spieces[5][1] then
- CurrentSpieces = Spieces[4][2]
- elseif Spieces_Id < Spieces[4][1] then
- CurrentSpieces = Spieces[5][2]
- else
- CurrentSpieces = Spieces[1][2]
- end
- return CurrentSpieces
- end
- repeat
- local RequestedNumber = Get_RandomNumber(LowestNumberMax, HighestNumberMax)
- local TypeChanace = RandomChance()
- local Spieces = SpiecesType(RequestedNumber)
- if TypeChanace == false and RequestedNumber == WantedNumber then
- RequestedNumber = RequestedNumber + 1
- end
- CurrentNumber = RequestedNumber; CurrentType = TypeChanace; GlobalSpieces = Spieces
- Generation = Generation + 1 print(Spieces, 'Gen #',Generation,' GenType',CurrentType)
- print('Gen #',Generation,'Race',Spieces,'Type',TypeChanace)
- until
- RequestedNumber == WantedNumber
- --\\End Finis
- print('Generation [',Generation,'] Race [',GlobalSpieces,']','Gen_Type [',CurrentType,']')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement