Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Globals variables And Arguments
- local RS = game.ReplicatedStorage
- local events = RS.Events
- local player = game.Players.LocalPlayer
- --Check
- function check(p, i)
- if p:FindFirstChild(i) then
- return true
- else
- return false
- end
- end
- --Delete Pet thing
- function petdel(pet)
- events.PetCommand:FireServer(pet.Name, "Delete")
- end
- --Main script to fix(Game uses id to sell the pets btw)
- if check(player, "PlayerGui") and check(player.PlayerGui, "Gui") and check(player.PlayerGui.Gui, "Submenus") and check(player.PlayerGui.Gui.Submenus, "PetsInventory") and check(player.PlayerGui.Gui.Submenus.PetsInventory, "PetsFrame") and check(player.PlayerGui.Gui.Submenus.PetsInventory.PetsFrame, "Frame") then
- for i,v in pairs(player.PlayerGui.Gui.Submenus.PetsInventory.PetsFrame.Frame:GetChildren()) do
- if v:IsA("ImageButton") and check(v, "IMG") and v.IMG.Parent.Name then
- local PLR_PET = v.IMG:FindFirstChildOfClass("ViewportFrame").Name
- if RS.Pets:FindFirstChild(PLR_PET) then
- if RS.Pets[PLR_PET].Rarity.Value == "1" then
- petdel(v)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment