Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I'm haveing issues with a script no errors or anything?

Asked by 6 years ago

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)
0
i didnt read the whole script but definitely do this game.Workspace["P2"]:Destroy() stinkyest11 78 — 6y
0
That won't work. User#19524 175 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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

Ad

Answer this question