local cost = 2500
local PetModule = require(game.ServiceScriptService:WaitForChild("PetModule"))
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player.leaderstats.Cash.Value >= cost then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - cost local pet = PetModule.choseRandomPet() print(pet.Name.." selected") game.ReplicatedStorage.HatchEgg:FireClient(player,pet) end
end)
Thanks for help
It's ServerScriptService
instead of ServiceScriptService