local players = game:GetService("Players")
function onTouched(part) local player = players:GetPlayerFromCharacter(part.Parent) if player then local abzx = player.PlayerGui.Objective1.Frame abzx:Destroy() end end
script.Parent.Touched:connect(onTouched)
The intended purpose of the code above is to remove (destroy) a GUI once something has been touched, in this case a door. I have tried changing the visibility of the GUI also but that does not work. Has anyone got any ideas?