On the client you could run a loop to check the distance between the character and the prompt part.
-- StarterCharacterScript
local RunService = game:GetService "RunService"
local Players = game:GetService "Players"
local Player = Players.LocalPlayer
local Character = Player.Character
local PromptDistance = 5
RunService.PreRender:Connect(function(DeltaTime)
local Difference = PromptPart.Position - Character.HumanoidRootPart.Position
local Distance = Difference.Magnitude
if Distance < PromptDistance then
GUI.Visible = true
else
if GUI.Visible then
GUI.Visible = false
end
end
end)
Once you are near it and looking at it, so get the direction the player is looking at and if it’s approximately there then you want to play an animation and move the player through, with CFrames.
If you’re playing Roblox on anything less powerful than a cell phone then you’re already going to be lagging even if this script didn’t exist. You wouldn’t crash.