Hello Everybody, So I have a pet inventory and I just started working on deletion for the unwanted pets that must be deleted. I have all the UI done, but when the player clicks on a pet template while having the pet deletor On. He/She should get prompted with a Frame(Which can be seen below)that asks if the player wants to complete the deletion. The issue is that the Yes and No don’t work. There seems to be no errors in the output.


LOCAL SCRIPT
local template = script.Parent
local delValue = game.Players.LocalPlayer.PlayerGui:WaitForChild("Inventory").LowerInvFrame.TextButton.delete["off/on"]
local DeleteWarn = game.Players.LocalPlayer.PlayerGui.Inventory.DeleteWarn
while wait(0.1) do
if delValue.Value == true then
template.MouseButton1Click:Connect(function()
-- warn player about deletion
-- figure name of pet that will be deleted so futher operatons will be achieved
DeleteWarn.Visible = true
end)
end
end
local Yes = DeleteWarn.Yes
local No = DeleteWarn.No
Yes.MouseButton1Click:Connect(function()
template:Destroy()
print("Successful deletion")
end)
No.MouseButton1Click:Connect(function()
DeleteWarn.Visible = false
print("NotDeleted")
end)