Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.PlayerAdded:Connect(function(player)
- --Pets stuff
- local PetsFolder = Instance.new("Folder",player); PetsFolder.Name = "PetsFolder"
- local Pets = Instance.new("Folder",PetsFolder); Pets.Name = "Pets"
- local PetsValues = Instance.new("Folder",PetsFolder); PetsValues.Name = "Values"
- local PetNameCheck = Instance.new("StringValue",PetsFolder); PetNameCheck.Name = "PetNameCheck"
- --Pets Values
- local Turtle = Instance.new("BoolValue",PetsValues); Turtle.Name = "Turtle"
- local Bunny = Instance.new("BoolValue",PetsValues); Bunny.Name = "Bunny"
- local Parrot = Instance.new("BoolValue",PetsValues); Parrot.Name = "Parrot"
- local PiggyBank = Instance.new("BoolValue",PetsValues); PiggyBank.Name = "Piggy Bank"
- local MrCrab = Instance.new("BoolValue",PetsValues); MrCrab.Name = "Mr.Crab"
- local PufferFish = Instance.new("BoolValue",PetsValues); PufferFish.Name = "Puffer Fish"
- local Hedgehog = Instance.new("BoolValue",PetsValues); Hedgehog.Name = "Hedgehog"
- local CrocodilePal = Instance.new("BoolValue",PetsValues); CrocodilePal.Name = "CrocodilePal"
- local KingFrog = Instance.new("BoolValue",PetsValues); KingFrog.Name = "King Frog"
- local Kitty = Instance.new("BoolValue",PetsValues); Kitty.Name = "Kitty"
- local EpicDuck = Instance.new("BoolValue",PetsValues); EpicDuck.Name = "Epic Duck"
- local Octopus = Instance.new("BoolValue",PetsValues); Octopus.Name = "Octopus"
- local PetRock = Instance.new("BoolValue",PetsValues); PetRock.Name = "Pet Rock"
- local SeaMonster = Instance.new("BoolValue",PetsValues); SeaMonster.Name = "Sea Monster"
- local Pikachu = Instance.new("BoolValue",PetsValues); Pikachu.Name = "Pikachu"
- local OOFSpider = Instance.new("BoolValue",PetsValues); OOFSpider.Name = "OOF Spider"
- local PetGojira = Instance.new("BoolValue",PetsValues); PetGojira.Name = "Pet Gojira"
- local Scorpion = Instance.new("BoolValue",PetsValues); Scorpion.Name = "Scorpion"
- local HungryShark = Instance.new("BoolValue",PetsValues); HungryShark.Name = "Hungry Shark"
- local AnnoyingOrange = Instance.new("BoolValue",PetsValues); AnnoyingOrange.Name = "Annoying Orange"
- local EvilUnicorn = Instance.new("BoolValue",PetsValues); EvilUnicorn.Name = "Evil Unicorn"
- local ArcticReindeer = Instance.new("BoolValue",PetsValues); ArcticReindeer.Name = "Arctic Reindeer"
- local Bird = Instance.new("BoolValue",PetsValues); Bird.Name = "Bird"
- local GrayWolf = Instance.new("BoolValue",PetsValues); GrayWolf.Name = "Gray Wolf"
- local Dog = Instance.new("BoolValue",PetsValues); Dog.Name = "Dog"
- local Otter = Instance.new("BoolValue",PetsValues); Otter.Name = "Otter"
- local AlienBee = Instance.new("BoolValue",PetsValues); AlienBee.Name = "Alien Bee"
- local TRex = Instance.new("BoolValue",PetsValues); TRex.Name = "T-Rex"
- local Phoenix = Instance.new("BoolValue",PetsValues); Phoenix.Name = "Phoenix"
- local HellDragon = Instance.new("BoolValue",PetsValues); HellDragon.Name = "Hell Dragon"
- --Hidden Pet Value
- local HiddenPetValue = Instance.new("BoolValue",PetsValues); HiddenPetValue.Name = "Eye of Cthulhu"
- -- Data Load
- local PlayerKey = string.format("%d_PETSDATA,", player.UserId);
- local GotData, DataReturn = pcall(Petsdata.GetAsync, Petsdata , PlayerKey)
- if (GotData and DataReturn ~= nil)then
- PetNameCheck.Value = DataReturn;
- Turtle.Value = DataReturn;
- Bunny.Value = DataReturn;
- Parrot.Value = DataReturn;
- PiggyBank.Value = DataReturn;
- MrCrab.Value = DataReturn;
- PufferFish.Value = DataReturn;
- Hedgehog.Value = DataReturn;
- CrocodilePal.Value = DataReturn;
- KingFrog.Value = DataReturn;
- Kitty.Value = DataReturn;
- EpicDuck.Value = DataReturn;
- Octopus.Value = DataReturn;
- PetRock.Value = DataReturn;
- SeaMonster.Value = DataReturn;
- Pikachu.Value = DataReturn;
- OOFSpider.Value = DataReturn;
- PetGojira.Value = DataReturn;
- Scorpion.Value = DataReturn;
- HungryShark.Value = DataReturn;
- AnnoyingOrange.Value = DataReturn;
- EvilUnicorn.Value = DataReturn;
- ArcticReindeer.Value = DataReturn;
- Bird.Value = DataReturn;
- GrayWolf.Value = DataReturn;
- Dog.Value = DataReturn;
- Otter.Value = DataReturn;
- AlienBee.Value = DataReturn;
- TRex.Value = DataReturn;
- Phoenix.Value = DataReturn;
- HellDragon.Value = DataReturn;
- HiddenPetValue.Value = DataReturn
- end
- game.Players.PlayerRemoving:Connect(function(player)
- local PlayerKey = string.format("%d_PETSDATA,", player.UserId);
- local data = {
- PetNameCheck = player.PetsFolder.PetNameCheck.Value;
- Turtle = player.PetsFolder.PetsValues.Turtle.Value;
- Bunny = player.PetsFolder.PetsValues.Bunny.Value
- }
- local Success = false
- if (not Success) then
- Success = pcall(Petsdata.SetAsync, Petsdata , PlayerKey, data)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement