I’m wondering how I could move GUID and Type from Inventory to Equipped?
GUID is a table. Type is a string in GUID.
local function EquipPet(Player, Type, GUID)
if PlayerSessionData[Player].Pets.Inventory[GUID] then
if DataService:Equipped(Player, "MaxEquipped") >= DataService:Equipped(Player, "CurrentEquipped") then
PlayerSessionData[Player].Pets.Inventory[GUID] = nil -- remove "GUID" from inventory.
PlayerSessionData[Player].Pets.Equipped = GUID[Type] -- add "GUID" into equipped.
end
else
return
end
end
It doesn’t work for some reason I tried to print the equipped pets, but it does not print.
PlayerSessionData[Player].Pets.Inventory[GUID][Type] = nil
PlayerSessionData[Player].Pets.Equipped[#PlayerSessionData[Player].Pets.Equipped + 1] = GUID[Type]
delay(1,function() --print.
for i,v in pairs(PlayerSessionData[Player].Pets.Equipped) do
print(i,v)
end
end)