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

UNANSWERED FOR 2 DAYS! Gui Script won't work?

Asked by
KenzaXI 166
8 years ago

The gui won't remove when it does everything it's meant to and I don't know why:

local i = script.Parent
local map = workspace.Map1.sa

function onButtonClicked()
    local plr = game.Players.LocalPlayer
    local character = plr.Character
    character:MoveTo(map.Position)
    for _, v in pairs(game.Lighting.tools:GetChildren()) do
    v:Clone().Parent = plr.Backpack
    end
    script.Parent.Parent.Parent:Remove()
end

i.MouseButton1Down:connect(onButtonClicked)


Thanks

0
Does the output say anything? lucas4114 607 — 8y
0
Something should come out on output... or console at least.. HungryJaffer 1246 — 8y
0
Try using Destroy as Remove is deprecated. Some deprecated items are less reliable than their newer counterparts (E.G: Destroy and Remove). If that doesn't work, check your parenting and make sure what you're removing is the GUI. Spongocardo 1991 — 8y
0
I've done all of that and it still won't work! KenzaXI 166 — 8y

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
8 years ago
--Use this
script.Parent.Parent.Parent:Destroy()
0
Already have KenzaXI 166 — 8y
Ad

Answer this question