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
01local i = script.Parent
02local map = workspace.Map1.sa
03 
04function onButtonClicked()
05    local plr = game.Players.LocalPlayer
06    local character = plr.Character
07    character:MoveTo(map.Position)
08    for _, v in pairs(game.Lighting.tools:GetChildren()) do
09    v:Clone().Parent = plr.Backpack
10    end
11    script.Parent.Parent.Parent:Remove()
12end
13 
14i.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