Ok so I made a door that has a selection box that is not visible so I made a local script that makes when your hover the mouse on the door the selection box shows and when you stop hovering the mouse it hides again but it only works with normal scripts and I want to make it so only the player that is hovering the mouse can see it
Here is the script:
script.Parent.ClickDetector.MouseHoverEnter:Connect(function() script.Parent.SelectionBox.Visible = true end) script.Parent.ClickDetector.MouseHoverLeave:Connect(function() script.Parent.SelectionBox.Visible = false end)
Use mouse.target
you have to get the mouse first from the player:
(in a localscript)
players = game:GetService ("Players") localPlayer = players.LocalPlayer mouse = localPlayer:GetMouse() door = -- door instance like idk workspace.door while true do if mouse.Target == door then door.SelectionBox.Visible = true else door.SelectionBox.Visible = false end
Plz tell me if there is any errors or misspellings im writing this on mobile