So I made this simple script that works almost perfectly. It's basically a part and when you step on it a TextLabel will appear on your screen, simple, but the debounce part ruins it. If 2 people step on the part at the same time the text will only show for 1 person, and nothing for the other. This is because of the debounce part. You could fix this by removing the debounce, but that is not very efficient, because the debounce is an important part of the script. I would really appreciate a good answer, I really need this to work.
Popup = script.Parent.Popup
debounce = true
function onTouch(hit)
local all = hit.Parent:FindFirstChild("Humanoid")
if all ~= nil and debounce == true then
debounce = false
local player = game.Players:FindFirstChild(all.Parent.Name)
local Gui = Popup:clone()
Gui.Parent = player.PlayerGui
wait(4)
Gui:remove()
wait(1)
debounce = true
end
end
script.Parent.Touched:connect(onTouch)

1 comment
Answered.