I have been stuck on this for hours. How would I go about making a billboardGui Only active for a player that hovers their mouse over it? Currently when I hover my mouse over it, every other player closeby can see it too. This is the current Script inside of the tool:
local frame = script.Parent
local clickDetector = frame:WaitForChild("ClickDetector")
local model = frame.Parent.Parent
local Close = model:WaitForChild("CabinetClose")
local Open = model:WaitForChild("CabinetOpen")
local opened = model:WaitForChild("Opened")
local tweenService = game:GetService("TweenService")
local interactGui = frame:WaitForChild("BillboardGui")
local selectbox = frame:WaitForChild("SelectionBox")
clickDetector.MaxActivationDistance = 10
script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
selectbox.Visible = true
interactGui.Enabled = true
end)
script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
selectbox.Visible = false
interactGui.Enabled = false
end)
local debounce = true
clickDetector.MouseClick:Connect(function()
if debounce == true then
debounce = false
if opened.Value == true then
selectbox.Visible = false
opened.Value = false
clickDetector.MaxActivationDistance = 0
tweenService:Create(frame,TweenInfo.new(0.65),{CFrame = Close.CFrame}):Play()
interactGui.Enabled = false
script.CabinetSound.Playing = true
else
selectbox.Visible = false
opened.Value = true
clickDetector.MaxActivationDistance = 0
tweenService:Create(frame,TweenInfo.new(0.65),{CFrame = Open.CFrame}):Play()
interactGui.Enabled = false
script.CabinetSound.Playing = true
end
wait(0.65)
debounce = true
clickDetector.MaxActivationDistance = 10
end
end)
This script gives me this something like this: