I have this LocalScipt that displays text on your screen when your mouse hovers over a block. Like hover over a dropped item and it will say "Pick up". The only problem with is that the range is infinite, you can hover over an item from really far away and still see the message,
LocalScript inside StarterGui
script.Parent is a textlabel that follows your mouse
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
mouse.Move:Connect(function()
script.Parent.Position = UDim2.new(0, mouse.X + 10, 0, mouse.Y + 5)
script.Parent.Visible = false
local target = mouse.Target
if target and target.Parent then
if target.Parent:FindFirstChild("Part") then
script.Parent.Text = "Click me!"
script.Parent.Visible = true
end
end
end)

4 comments
it works, but only backwards. If i walk close to the part i cant click it, but if I walk further away from it then I can click it
nvm I fixed it, the problem was that you added a greater not lower sign
ohhh yes, sorry
Can you mark the question as accepted as it solved th issue? I'll edit the script rn