Skip to content

Instantly share code, notes, and snippets.

@mvyasu
Last active May 31, 2025 09:52
Show Gist options
  • Select an option

  • Save mvyasu/fedb108cadd33678d1db55549bdb7d82 to your computer and use it in GitHub Desktop.

Select an option

Save mvyasu/fedb108cadd33678d1db55549bdb7d82 to your computer and use it in GitHub Desktop.
A very simple script that highlights objects with ProximityPrompts inside them.
--by @mvyasu
--June 2 2022
local ProximityPromptService = game:GetService("ProximityPromptService")
local Players = game:GetService("Players")
local highlightLookupDictionary = {}
ProximityPromptService.PromptShown:Connect(function(promptInstance)
if not highlightLookupDictionary[promptInstance] then
local highlightAdornee = promptInstance:FindFirstAncestorWhichIsA("BasePart") or promptInstance:FindFirstAncestorOfClass("Model")
local newHighlight = Instance.new("Highlight")
newHighlight.DepthMode = Enum.HighlightDepthMode.Occluded
newHighlight.FillColor = Color3.fromRGB(230, 230, 230)
newHighlight.FillTransparency = 0.75
newHighlight.Adornee = highlightAdornee
newHighlight.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
highlightLookupDictionary[promptInstance] = newHighlight
end
end)
ProximityPromptService.PromptHidden:Connect(function(promptInstance)
local proximityPromptHighlight = highlightLookupDictionary[promptInstance]
if proximityPromptHighlight then
highlightLookupDictionary[promptInstance] = nil
proximityPromptHighlight:Destroy()
end
end)
@ElectroModeYT
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment