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?
You could use a debounce, so that multiple touches without waiting for the full 2 seconds will be ignored:
local debounce = false script.Parent.Touched:connect(function(hit) if not debounce then debounce = true -- code debounce = false end end)