We can easily achieve the goal you want, by using something called tweening. This can make the GUI look nice, fading in and out.
Here:
First off, I'm assuming you put this in a server script because the proximity prompt is the parent of this script. I will write up two scripts, where one goes into the server, and another goes into the client.
local proximityPrompt = script.Parent
local guiRemote = nil
proximityPrompt.Triggered:Connect(function(player)
local char = player.Character
local root = char:WaitForChild("HumanoidRootPart")
root.CFrame = CFrame.new(-190.186, 6.862, -228.86)
guiRemote:FireClient(player)
end)
Now, its time for the client script. Place this script into your frame that you want to transition. For example, game.StarterGui.ScreenGui.Frame
local guiRemote = nil
guiRemote.OnClientEvent:Connect(function(player)
local frame = script.Parent
frame.Position = UDim2.new(2, 0,0.429, 0)
frame:TweenPosition(
UDim2.new(0,0,0.429,0)
"InOut",
"Linear",
1,
false
end)
wait(1)
frame:TweenPosition(
UDim2.new(2, 0,0.429, 0)
"InOut",
"Linear",
1,
false
frame.Visible = false
if this doesnt work, I can show you tween size, which is more convenient, but for now, try this