Hello for the past 15 mins I’ve been stuck on trying to solve this issue, what I am trying to achieve is that when a player gets near this block, it highlights, and when they go away it gets un highlighted, nothing is working and it doesn’t send a error message, the script is in side of the model in workspace and the game is single player so im not worried to much about client
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Defined Variables
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
local Cube = script.Parent:WaitForChild("Cube")
local Proximity = script.Parent:WaitForChild("ProximityPrompt")
--
Proximity.PromptShown:Connect(function()
local newHighlight = Instance.new("Highlight")
newHighlight.Parent = Cube
newHighlight.FillColor = Color3.new(0.341176, 0.466667, 0.705882)
newHighlight.OutlineColor = Color3.new(0.0588235, 0.0588235, 0.0588235)
print(" Showing Highlight ")
end)
Proximity.PromptHidden:Connect(function()
local Highlight = Cube:FindFirstChild("Highlight")
if Highlight then
Highlight:Destroy()
else
print(" No Highlight Detected ")
end
end)