local ScreenGui = script.Parent
local Var = false
ScreenGui.ImageButton1.MouseButton1Down:Connect(function()
Var = true
end)
ScreenGui.ImageButton1.MouseButton1Up:Connect(function()
Var = false
end)
if Var == true then
print('Is True')
end
It wont work even if i put Var == true then
is there any other solution?

1 comment
right idea, you're forgetting a while loop