So the problems with this script are that it does not destroy itself and when the script tells it to close a gui it does not close. No errors. Please provide me with a script that fixes this, thanks.
Here is the script:
local Clicks = 3
local Confirm = game.StarterGui.Confirm
script.Parent.MouseClick:connect(function(player)
Clicks = Clicks +1
game.Players.LocalPlayer.leaderstats.Trash.Value = game.Players.LocalPlayer.leaderstats.Trash.Value +25
Confirm.Parent = player.PlayerGui
script.Parent.Parent.Sound:Play()
Confirm.Enabled = true
if(Clicks < 3) then
game.Workspace.P2:Destroy()
wait(.5)
Confirm.Enabled = false
end
end)

2 comments
i didnt read the whole script but definitely do this game.Workspace["P2"]:Destroy()
That won't work.