Last active
May 31, 2025 09:52
-
-
Save mvyasu/fedb108cadd33678d1db55549bdb7d82 to your computer and use it in GitHub Desktop.
A very simple script that highlights objects with ProximityPrompts inside them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --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) |
Author
very helpful
Help add more commands. With the item in hand, Highlight disappeared. :) Thx
Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's an alternative way of doing this that's more simple. There was a reason why I didn't use this way in the video, but that reason is no longer relevant: