Hi guys, I’ve recently come across a weird bug where when I click a button, it sometimes activates but sometimes doesn’t. I’ve tried lots of different events for example MouseButton1Click, MouseButton1Down, Activated, etc - none seem to work. Also, it’s not just a studio bug because it happens in the actual game too.
A reply below would be appreciated by anyone who knows a potential fix to my issue. Thanks!
I don’t think the issue is with my code - I logged to check if Roblox is receiving my click and most of the time, it doesn’t. But here is my code anyways:
-- Open Options --
script.Parent.Main.Topbar.Menu.MouseButton1Down:Connect(function()
if script.Parent.Main.Menu.Position == UDim2.new(-0.305, 0, 0, 0) then
ripple.exec(script.Parent.Main.Topbar.Menu, mouse)
script.Parent.Main.Menu:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", 0.05, true)
end
end)
-- Close Options --
script.Parent.Main.Menu.Exit.MouseButton1Down:Connect(function()
if script.Parent.Main.Menu.Position == UDim2.new(0, 0, 0, 0) then
ripple.exec(script.Parent.Main.Menu.Exit, mouse)
script.Parent.Main.Menu:TweenPosition(UDim2.new(-0.305, 0, 0, 0), "Out", "Linear", 0.05, true)
end
end)