Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this piece of code in relation to a GUI not working?

Asked by 8 years ago

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?

Answer this question