This is the code I have
local Tool = script.Parent
local player = game.Players.LocalPlayer
Tool.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if Mouse.Target == game.Workspace.EmeraldBlock.Part then
player.PlayerGui.ScreenGui.Frame.Visible = true
player.PlayerGui.ScreenGui.Frame.Frame1:TweenSize(UDim2.new(1.01, 0,0.63, 0), nil, "Linear", 5, false )
end
end)
Mouse.Button1Up:Connect(function()
if Mouse.Target ~= game.Workspace.EmeraldBlock.Part then
player.PlayerGui.ScreenGui.Frame.Visible = false
player.PlayerGui.ScreenGui.Frame.Frame1:TweenSize(UDim2.new(0, 0,.63,0), nil, nil, .01, true )
end
end)
end)
What happens is when I move my mouse away from the block while i'm holding down mouse button 1, the GUI continues to tween, even though the mouse target is no longer that part

2 comments
"Moved is not a valid member of Mouse" That's the error I am getting
I fixed it.