How to make MouseButton1Up stop firing multiple times on button click

I’ve tried to fix it but have found no success.
This segment is within a function for something else.
The buttons are created with Instance.new and are parented to a gui.

I’ve checked on the devforum and got a general gist on what is happening but do not know how to solve this problem. If you need anything clarified feel free to ask for it.

image

I would put a bool value somewhere.

something like this:

local playerPressedButtonOnce = false

if playerPressedButtonOnce == false then
playerPressedButtonOnce = true
-- whatever you want to happen put here

end

This makes sure the player can’t fire it twice. Not the exact code you would need, but I think you know how you could move it around to fit in there.

I can’t believe I didn’t think of this solution. Its so simple. Thanks man, I used your solution so I’ll show it off.

image

1 Like