of     1   

Mezur
#183118583Saturday, February 06, 2016 11:09 PM GMT

SO I made this script where if you touch a brick with this script inside of it, a GUI pops up. For some reason multiple GUI's pop up if you continuously touch the brick. How can I prevent that? I also want to make it so when the GUI pops up you become anchored until you click exit on the GUI. How can I do this stuff? local debounce = false function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end end return nil end function onTouch(part) local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then debounce = true local player = getPlayer(human) if (player == nil) then return end user = game.Players:findFirstChild(human.Parent.Name) script.Parent.ShopGUI:clone().Parent = player.PlayerGui wait(2) else wait(2) debounce = false end end script.Parent.Touched:connect(onTouch)
Mezur
#183118690Saturday, February 06, 2016 11:11 PM GMT

bump 1
Mezur
#183118766Saturday, February 06, 2016 11:13 PM GMT

bump 2
Mezur
#183118822Saturday, February 06, 2016 11:14 PM GMT

bump 3
Mezur
#183118872Saturday, February 06, 2016 11:15 PM GMT

bump 4
Mezur
#183118991Saturday, February 06, 2016 11:17 PM GMT

bump 5

    of     1