#Deleting the gui from the playergui

1 messages · Page 1 of 1 (latest)

delicate ore
#

i'm trying to delete a gui from the playergui but it doesn't delete. even though all the prints pass through.

vivid kite
delicate ore
vivid kite
#

but you already used a wait forchild for it

#

on the first line

#

so you can just use .

#

and i cant see why it is not working

#
local switch = script.Parent.ClickDetector

switch.MouseClick:Connect(function(plr)
    if plr.PlayerGui:WaitForChild("ScreenGui").Parent == plr.PlayerGui then
        print("found the gui")

        plr.PlayerGui:FindFirstChild("ScreenGui"):Destroy()
    end
    script.Enabled = false
end)
#

i tried doing that and it is working

#

it is literally the same as yours

delicate ore
#

i mean i can record you a video that it's not working

vivid kite
#

sure

delicate ore
#

damn

#

stupid mkv

vivid kite
#

dw

#

i saw it already

delicate ore
#

alright

vivid kite
#

look

#

try printing print(plr.PlayerGui.ObjectiveGui) before and after it destroys

delicate ore
#

will try, wait

vivid kite
#

and t ell me what happens

delicate ore
#

why the fuck does it work when i put the prints away

delicate ore
#

istg

vivid kite
delicate ore
#

yeah

vivid kite
#

do you have sure it is the right gui?

delicate ore
#

out of nowhere apparently

#

no like, it's doing what it's supposed to do

#

but only after i put the prints away

vivid kite
#

huh

#

your roblox studio might be possessed

delicate ore
#

probably

#

sorry for wasting your time tho

vivid kite
#

no problerm

buoyant ginkgo
#

also
plr.PlayerGui:WaitForChild("ObjectiveGui").Parent == plr.PlayerGui
doesn't make sense

delicate ore
buoyant ginkgo
#

I am, I was wondering for what you need it and not trying to be rude 😭

delicate ore
#

i am making it so it deletes the current objective and replaces it with another one