Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

3 comments

0

Or just use :Destroy()

0

Didn't work D:

0

Maybe it's your parents. Are you sure you have the correct number of Parents?

This discussion is preserved as it was. New answers, comments, and votes are closed.