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

brick onTouch debounce only for 1 person? [closed]

Asked by 10 years ago

This question already has an answer here:

PlayerGui only works for me, not others!?

This brick makes GUI debounce for all players which means if 1 person steps on it and it shows it to him, for the other person it won't because debounce is equal to true. How would i make it so debounce is per person so more than 1 person could step on a brick and it would still show it to him?

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 :(

Help!

0
Same thing happened when i tried making a Player Entered Game GUI, it only showed the GUI to the player who entered, not anyone else. Why is it like that? NonSpace 0 — 10y
0
Why would the debounce be set for everyone and not just one person? NonSpace 0 — 10y

Marked as Duplicate by NotsoPenguin, Muoshuu, EzraNehemiah_TF2, and Spongocardo

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?