I made a script where when you have your mouse on a certain part and it shows a GUI that follows your mouse, but it won't work. Can somebody help me with it?
local Plyr = game.Players.LocalPlayer
local Mouse = Plyr:GetMouse()
local Object = game.Workspace.Interact1
while true do
if Mouse.Target == Object then
script.Parent.MouseGUI.TextLabel.UDim2 = UDim2.new(Mouse.UDim2)
elseif Mouse.Target ~= Object then
wait(0.0000000000000000000001)
script.Parent.MouseGUI.TextLabel.UDim2 = UDim2.new(0,-500,0,0)
end
wait()
end

1 comment
UDim2 is not a property of GUIs. It is used to define the size or position of a GUI. You'd put .Position or .Size in it's place.