Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My shop UI local script does not work as I want it to, what should I change?

Asked by
F_F 53
6 years ago

Whenever you press the "Buy" button it purchases everything multiple times but what I am trying to make it do is purchase something one time only and then remove the "Buy" button.

Here are some screenshots and a GIF for better visual understanding:

https://gyazo.com/06de0f72058726c034ea09ee15eac2f8 https://gyazo.com/af16c0e1354b9db5d441cf4fa62efab3 https://gyazo.com/b234238bae1304c13224bf3f95f0601e

0
Add a debounce. awfulszn 394 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

mosski123 is right adding a debounce will fix your problem

in the mousebutton 1 down

local x = false
if x == false
--purchase item
x = true
end
-- if you want them to buy it again later just set it back to false
Ad

Answer this question