Billboard GUI Active for EVERYONE

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:

1 Like

you can change the RunContext of the script to be Client sided, it still works on parts, but it’ll show for the player only!

1 Like

How would I do that, is it a property or something I write inside of a script?

1 Like

Nevermind I can see the property now, I’m changing from legacy to client.

1 Like

it is in properties, i do recommend you write the mouseclick function on a regular script, since everything in there will be visible and happen FOR the client

1 Like

I was going to say, How would I use this on a door that is clickable by everyone, because some player might see it opened and some might see it closed.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.