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?

1local detect = script.Parent
2local quest = game.ReplicatedStorage.quest1
3local box = script.Parent.Parent.select
4 
5detect.MouseHoverEnter:connect(function(plr)
6    box.Visible = true
7end)

1 answer

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

Put this in workspace - server script

01local detect = script.Parent
02local quest = game.ReplicatedStorage.quest1enter
03local questleave = game.ReplicatedStorage.quest1leave
04 
05detect.MouseHoverEnter:connect(function(plr)
06    quest:FireClient(plr)
07end)
08 
09detect.MouseHoverLeave:connect(function(plr)
10    questleave:FireClient(plr)
11end)

Put this in startergui - local script

01local quest = game.ReplicatedStorage.quest1enter
02local box = game.Workspace["      "].select
03local questleave = game.ReplicatedStorage.quest1leave
04 
05quest.OnClientEvent:connect(function(plr)
06    box.Visible = true
07end)
08 
09questleave.OnClientEvent:connect(function(plr)
10    box.Visible = false
11end)

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