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

Why won't Gui be removed when the script runs everything else correctly?

Asked by
KenzaXI 166
9 years ago
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)

I have no why it won't work, My output doesn't give any errors either

1 answer

Log in to vote
0
Answered by 9 years ago

Instead of using :Remove() try setting the parent to nil.

0
Or just use :Destroy() Discern 1007 — 9y
0
Didn't work D: KenzaXI 166 — 9y
0
Maybe it's your parents. Are you sure you have the correct number of Parents? Vill1234 15 — 9y
Ad

Answer this question