I'm trying to make a gui visible when I hold down left mouse button and make it disappear when I let go of the left mouse.
This is the code I wrote but I don't know why it isn't working
local circle = script.Parent.Circle
local UIS = game:GetService("UserInputService")
local MouseDown = false
UIS.InputBegan:Connect(function(a)
if a.UserInputType == Enum.UserInputType.MouseButton1 then
circle.Visible = true
end
end)
UIS.InputEnded:Connect(function(a)
if a.UserInputType == Enum.UserInputType.MouseButton1 then
circle.Visible = false
end
end)
