So I've been using debounce for a long time now and i had many problems. For example, why when i make debounce for a point giver brick onTouch and it activates debounce for all players not just the player who touched it. So when 1 person touches it it gives him points, but when another person touches it right after that person it doesn't do anything. Same thing when i used making GUI slide on screen on brick onTouch, it works for one person, but right after that when another person touches it it doesn't work for them, unless they wait 10 seconds, then it works for the first person to touch it again. Why does it set debounce for everyone and not just the person who touched the brick? Please explain?
How would i use debounce?
debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == false then
debounce = true
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.PlayerGui.Intro.Window.Text.Visible = true
player.PlayerGui.Intro.Window:TweenPosition(UDim2.new(0,0,0.5,150))
player.PlayerGui.Intro.Window.Text.Text = "Remember what i said? Red bricks are a no no. Try to avoid them as much as possible! (Hint: They kill you) ~NonSpace"
-- first time learning Tweening!
wait(10)
player.PlayerGui.Intro.Window:TweenPosition(UDim2.new(0,0,0.5,400))
wait(1)
player.PlayerGui.Intro.Window.Text.Visible = false
debounce = false
end
end
end)
-- Only works for the first person :(

1 comment
Please don't thumbs down, i just need to know. Its urgent