Skip to content

Commit

Permalink
Fix button being stuck as pressed when hover ended while mouse down.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNexusAvenger committed Mar 29, 2023
1 parent fbb6b78 commit 7304019
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ function NexusButton:__new(): ()
self.MouseButton2Click:Fire()
end
end))
table.insert(self.Events, UserInputService.InputEnded:Connect(function(Input)
if not self.Pressed then return end
if Input.UserInputType ~= Enum.UserInputType.MouseButton1 then return end
self.Pressed = false
end))

--Set the defaults.
self.Size = UDim2.new(0, 200, 0, 50)
Expand Down

0 comments on commit 7304019

Please sign in to comment.