I am looking to create a 'tooltip' for my game, and i want to put it next to the mouse when they scroll over it.
All I need is to know if there is a function for it if so, could you provide the link to the wiki?
I am looking to create a 'tooltip' for my game, and i want to put it next to the mouse when they scroll over it.
All I need is to know if there is a function for it if so, could you provide the link to the wiki?
local mouse = game.Players.LocalPlayer:GetMouse()
local tool_tip = Instance.new("TextLabel")
mouse.Move:connect(function()
if mouse.Target then
local target = mouse.Target
tool_tip.Parent = script.Parent
tool_tip.Text = target.Name
tool_tip.Size = UDim2.new(0,tool_tip.TextBounds.X,0,tool_tip.TextBounds.Y)
tool_tip.Position = UDim2.new(0,mouse.X-tool_tip.TextBounds.X,0,mouse.Y-tool_tip.TextBounds.Y)
else
tool_tip.Parent = nil
end
end)
Let's say you have a tool and put in starter gear You can use Function make sure the script inside the tool is a local script
game.Players.PlayerAdded:connect(function(plr)
local mouse = plr:GetMouse()
for i = 1, 1 do
print(mouse.X, mouse.Y)
wait(3)
end
end)
Idk if it works
I'm asking if there is a way to detect the mouse without a tool.
Oh mk
Tada?
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This is quite interesting. But I'm going to need to edit it a bit :/