Me and my friend finished Alvin_Blox's pet system tutorial. He never taught how to make a delete pet button. After some time, me and my friend did a script.
In the delete button we did a LocalScript.
local player = game.Players.LocalPlayer
local petName = script.Parent.Parent.PetName
local PetInventory = player:WaitForChild("PetInventory")
script.Parent.MouseButton1Click:Connect(function()
local weNeedToDeleteThis = PetInventory:FindFirstChild(petName.Text)
weNeedToDeleteThis:Destroy()
script.Parent.Parent:Destroy()
end)
Player gets the player PetName gets the name of the pet PetInventory gets the player's pet inventory, where the pets are held in stringvalue weNeedToDeleteThis is what we need to delete
The script actually worked, we were very happy. Then I said "try the data, see if it saved." Nope. It does not save the delete... when we rejoined our pets were back.
If someone could teach how this could save -- that would be greatly appreciated.
Respond to this or DM ItzPolar_YT#5778 on Discord or DM @ItzPolarYT on Twitter.
Thanks, ItzPolar_YT (Sour Studios :D Owner, Object Simulator Developer)

1 comment
Use a script instead of a local script, and in the script you use to save the pets try adding a function to check whether or not something has happened to the pet