So I have this code thats either suppose to:
A. tell when you click
B. Tell when your moues leaves a certain frame.
Now for the most part it works except it just doesnt detect when the user clicks and I dunno why. My code
Connections['ChangeTime'] = frame:FindFirstChild('TIme'):FindFirstChild('Time'):FindFirstChild('Time').MouseEnter:Connect(function()
print('Entered')
local clicked = 0
Connections['ClickEnter'] = uis.InputBegan:Connect(function(input,g)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print('Clicked')
clicked = 2
end
end)
frame:FindFirstChild('TIme'):FindFirstChild('Time'):FindFirstChild('Time').MouseLeave:Once(function()
clicked = 1
end)
repeat task.wait() until clicked ~= 0
print(clicked)
Connections['ClickEnter']:Disconnect()
if clicked == 2 then
local actualPo = UDim2.new(0,mouse.X - frame.AbsolutePosition.X,0,mouse.Y - frame.AbsolutePosition.Y)
local z = Instance.new('Frame')
z.Parent = frame:FindFirstChild('TIme'):FindFirstChild('Time'):FindFirstChild('Time')
z.Position = actualPo
end
end)
btw it does print click
, but its always 1. The print inside the click event never prints either