Code:
local cost = 500
local petModule = require(game.ServerScriptService:WaitForChild("PetModule"))
script.Parent.ClickDetector.MouseClick:Connect(function()
if player.leaderstats.Cash.Value >= 500 then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - cost local pet = petModule.chooseRandomPet() print(pet.Name.." selected") game.ReplicatedStorage.HatchEgg:FireClient(player,pet) end
end)
Please help me fix