Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Plieax 66
6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by
Plieax 66
6 years ago

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.

Ad

Answer this question