Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

connecting local script to mouse enter with click detector? {Solved}

So i want it so when the players mouse enters the click detector that it prints that it will make the hitbox only visible for that player. What do i do to make it work?

local detect = script.Parent
local quest = game.ReplicatedStorage.quest1
local box = script.Parent.Parent.select

detect.MouseHoverEnter:connect(function(plr)
	box.Visible = true
end)

1 answer

Put this in workspace - server script

local detect = script.Parent
local quest = game.ReplicatedStorage.quest1enter
local questleave = game.ReplicatedStorage.quest1leave

detect.MouseHoverEnter:connect(function(plr)
	quest:FireClient(plr)
end)

detect.MouseHoverLeave:connect(function(plr)
	questleave:FireClient(plr)
end)

Put this in startergui - local script

local quest = game.ReplicatedStorage.quest1enter
local box = game.Workspace["      "].select
local questleave = game.ReplicatedStorage.quest1leave

quest.OnClientEvent:connect(function(plr)
	box.Visible = true
end)

questleave.OnClientEvent:connect(function(plr)
	box.Visible = false
end)


Should work if you change the names and stuff to what yours are if you are using this article for you own help.

This discussion is preserved as it was. New answers, comments, and votes are closed.