#Hello i have made a pet system like 4 months ago.. and now its broken and idk what i need to do with

25 messages · Page 1 of 1 (latest)

glossy maple
#

Ima trying to get all pets from database and this happened

toxic pier
glossy maple
#

There is it

#

if u want to

#

function PetIDHandler.GetPets()
    local DS = game:GetService('DataStoreService')
    local Pets = DS:GetDataStore('Pets')
    local pets = nil

    local success, err = pcall(function()
        print(Pets:GetAsync("AllPets", "Pets"))
        --pets = Pets:GetAsync("AllPets", "pets")
    end)
    if not success then warn(err) return end
    if not pets then 
        pets = {} 
    end
    return pets
end```
#

it was working in last 4 months

#

but now nope..

toxic pier
glossy maple
#

he should

toxic pier
#

Also, GetAsync only accepts one parameter, yet you're sending two for some reason

#

I would recommend you read about datastore's and understand how they work before using them

glossy maple
#

i know how its works.. but i returned in like 4 months and iam lost again .. :D

solid steppeBOT
#

studio** You are now Level 11! **studio

toxic pier
#

Robloxs documentation or a YouTube video always helps

toxic pier
glossy maple
#

mby my friend try to play with my code so idk.. but yes "AllPets" without another argument

glossy maple
#

with

#

pet name, pet id, pet owner id, enchantments

#

etc..

#

do basically Pet = {
"pet id": 45646456,
....
} //in python iam lost in lua again :D

#

prob my friend trying to change it :D

#

he aslo changed this