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)
Hello there,
I have fixed your script according to my knowledge, if there is something wrong with it, explain what happened in the comments, or in the community chat, here is the script:
game:GetService('Players').PlayerAdded:Connect(function(Player) local Clicks = 3 local Confirm = game.StarterGui.Confirm script.Parent.MouseClick:Connect(function() Clicks = Clicks +1 Player.leaderstats.Trash.Value = Player.leaderstats.Trash.Value + 25 Confirm.Parent = Player.PlayerGui script.Parent.Parent.Sound:Play() Confirm.Enabled = true if(Clicks > 3) then game:GetService('Workspace'):FindFirstChild("P2"):Remove() wait(.5) Confirm.Enabled = false end end) end)
MAKE SURE THIS IS A REGULAR SCRIPT!
I hope I helped,
~Frag