Guys, I've been trying to find a solution to this problem for some time and I don't find that somewhere, so I would like to count on your help.
As described in the title: How could I make the debounce feature only act for the person who stepped on the block (in my case)? Here's my script (after thousands of changes):
local brick = script.Parent
local brickTouchedEvent = game.ReplicatedStorage.Events.BrickTouched
local debounce = false
brick.Touched:Connect(function(hit)
if not debounce then
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.PlayerGui.Objetivos.TutorialGUI.Objetivo.Text = "Pule pelas plataformas até chegar no terceiro CHECKPOINT."
brickTouchedEvent:FireClient(player)
print(player.Name.." passou pelo segundo checkpoint")
debounce = true -- I want that the player can't activate it again after activate it once --
end
end)
And, to be sure, the form of activate the GUI when a player steps on the block is correct? My idea is to make when the player passes through an area of the game this gui activate and tell you what to do next, here's my script:
brickTouchedEvent.OnClientEvent:Connect(function()
openClose() -- This is a functions of my code that I want to run when the player touch the part with the script --
end)
(In my "Replicated Storage" has a remote event as shown in the first script.)
Thank you very much for your attention. Eduardo

1 comment
Can you please give us the openClose() code? that is most likely the reason for the not work