Ok so, the gui shows perfectly fine, BUT. After it has shown and the player touched the block again the gui instantly disappears and doesn't wait the 2 seconds again?
Value = game.Workspace.Portals.Blue
function onTouched(part)
if Value.Value == false then
local Player = game.Players.LocalPlayer
local Frame = Player.PlayerGui.Messages.Locked
Frame.Visible = true
wait(2)
Frame.Visible = false
else
part.CFrame = CFrame.new(script.Parent.Parent.Parent.BlueR1.Position.x, script.Parent.Parent.Parent.BlueR1.Position.y + 5, script.Parent.Parent.Parent.BlueR1.Position.z)
end
end
script.Parent.Touched:connect(onTouched)
EDIT: Sometimes it does wait, sometimes it doesn't?

2 comments
When you set Frame.Visible to true, you should also set Value.Value to true. Then, after the two second wait-time, when you set the Frame.Visible to be false, you should set the Value.Value to false as well.
But setting Value.Value to true will cause the player to run the part.CFrame, which is not what I want.