How do I make a prompt like this?

I want to make a system to vault windows, does anyone know how I can do this?

Every time you get close to that orange block an interface appears, as if it were a proximity prompt but it appears on your screen

(I couldn’t find something similar on the forum)

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)
3 Likes

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.

1 Like

But wouldn’t it be too much to be checking all the windows every frame? Wouldn’t some devices not as powerful as a cell phone make the game crash?

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.