Alright, so I added a GUI and a frame under the GUI and a script under the frame. My script was this:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local frame = script.Parent local x local y local pressed = false mouse.Button1Down:Connect(function() pressed = true end) mouse.Button1Up:Connect(function() pressed = false end) while wait(0.01) do x = mouse.X y = mouse.Y if pressed == true then local dot = Instance.new("ImageLabel") dot.Parent = frame dot.Name = "Dot" dot.BackgroundTransparency = 1 dot.Image = "http://www.roblox.com/asset/?id=3195888012" dot.ImageColor3 = Color3.new(0,0,0) dot.Size = UDim2.new(0, 3, 0, 3) dot.Position = UDim2.new(0, x, 0, y) end end
I believe that the dot.Position is written out wrong. Anyone out there that knows how to fix it? Try it out yourself.
Now this was deceptively easy.
Just minus the mouse.X
by frame.AbsolutePosition.X
and mouse.Y
by frame.AbsolutePosition.Y
. The problem is that the computer thinks you want the dot to be as far away from the frame's top-right corner as the mouse is away from the screen's top-right corner.