Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- math.randomseed(tick())
- local Datastore = game:GetService("DataStoreService"):GetDataStore("PlayerData")
- local prefix = "|user_key|"
- game.Players.PlayerAdded:Connect((function(player)
- local stats = Instance.new("Folder", player)
- stats.Name = "Stats"
- --
- local family = Instance.new("StringValue", stats)
- family.Name = "Family"
- family.Value = "None"
- --
- local function RFamily(FamilyRarity)
- local Irregulars = {"Nameless", "Zahard"}
- local GreatFamilies = {"Ari","Arie","Eurasia","Ha","Hendo Lok","Koon","Lo Po Bia","Po Bidau","Tu Perie","Yeon"}
- local SpecialFamilies = {"Blitz","Grand","Edrok","Mule","Nissam","Jaina"}
- local NormalFamilies = {"Buelsar","Chang","Hong","Juglom","Nare","Hatchid","Yeo","Mei","Faker","Fodder","Nya","Red","Kang","Hyun","Royal"}
- local FamiliesHolder = {"Irregulars","GreatFamilies","SpecialFamilies","NormalFamilies"}
- local function FRChooser()
- for i,v in pairs(FamiliesHolder) do
- math.random(1,#FamiliesHolder)
- if FamiliesHolder == 1 then
- print("Irregulars")
- elseif FamiliesHolder == 2 then
- print("GreatFamilies")
- elseif FamiliesHolder == 3 then
- print("SpecialFamilies")
- elseif FamiliesHolder == 4 then
- print("NormalFamilies")
- end
- end
- end
- local function RandomTable(TableFamily)
- return TableFamily[math.random(#TableFamily)]
- end
- if FamilyRarity == "Irregulars" then
- return RandomTable(Irregulars)
- end
- if FamilyRarity == "GreatFamilies" then
- return RandomTable(GreatFamilies)
- end
- if FamilyRarity == "SpecialFamilies" then
- return RandomTable(SpecialFamilies)
- end
- if FamilyRarity == "NormalFamilies" then
- return RandomTable(NormalFamilies)
- end
- family.Value = TableFamily
- end
- local Save = Datastore:GetAsync(prefix .. tostring(player.UserId))
- if Save then
- family.Value = Save[1] or "None"
- end
- game.Players.PlayerRemoving:Connect(function(player)
- Datastore:SetAsync(prefix .. tostring(player.UserId), {
- player.Stats.Family.Value
- })
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement