Advertisement
Jackthehunter25

Untitled

Jan 24th, 2021
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. local Rarities = require(game.ServerScriptService:WaitForChild("petModule"))
  2.  
  3. script.Parent.ClickDetector.MouseClick:Connect(function(player)
  4.  
  5. if player.leaderstats.Coins.Value >= 500 then
  6.  
  7. player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 500
  8.  
  9. local pet = Rarities.chooseRandomPet()
  10.  
  11. print(pet.Name.." selected")
  12.  
  13. local petVal = Instance.new("StringValue")
  14. petVal.Name = pet.Name
  15. petVal.Parent = player.PetInventory
  16. game.ReplicatedStorage.HatchEgg:FireClient(player,pet)
  17.  
  18.  
  19.  
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement