Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I am having a problem with this code and it says that I player is mistyped but it really is not?

Asked by 3 years ago
Edited 3 years ago

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

Answer this question