Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function octopus.Serials:GenerateOctoSerial()
- local s = math.random( 100, 100000 )
- if ( table.HasValue( self.Active, s ) ) then
- -- A serial by this number already existed.
- print("Serial generated already was registered, recalculating...");
- repeat
- s = math.random( 100, 100000 )
- until !table.HasValue( self.Active, s )
- print("Serial was regenerated as " .. tostring(s) .. " successfully!");
- table.insert( self.Active, s );
- -- Save the serials here.
- self:Save();
- else
- table.insert(self.Active, s );
- -- Save the serials here.
- self:Save();
- end
- return s
- end
- function PlayerMeta:OctoID()
- -- Don't let them pass without a steamid, obviously.
- if ( not self:SteamID() ) then return end
- -- Then turn the steamid into a storable id
- local steamid = self:SteamID()
- local id = string.gsub( steamid,"STEAM","" );
- id = string.gsub( id,":","" );
- id = string.gsub( id,"_","" );
- return id;
- end
Add Comment
Please, Sign In to add comment