I've been trying to do this for about 2 hours now and I just can't seem to find the answer that I'm looking for. Hopefully, someone helps me with this.
here's my script:
local Playergui = game.Players.LocalPlayer.PlayerGui
function onTouch(part)
if Playergui.ScreenGui then
Playergui.ScreenGui:Destroy()
end
end
script.Parent.Touched:connect(onTouch)

1 comment
It worked! Thanks!