local debounce = false script.Parent.Touched:connect(function(hit) if not debounce then debounce = true local player = game.Players:GetPlayerFromCharacter(hit.Parent) player.PlayerGui.CapGui.BeingCapped.Text = "Blue Noobs base is being captured!" for i = 0, 100, 1 do wait(0.2) player.PlayerGui.CapGui.CapPercentage.Text = i .. "%" player.PlayerGui.CapGui.CapAnimation.Size = UDim2.new(0, i, 0, 30) end if player.PlayerGui.CapGui.CapPercentage.Text == "100%" then player.PlayerGui.CapGui.BeingCapped.Text = "Blue Noobs base has been captured!" end debounce = false end end)
This only effects the player that steps on the brick. How do I edit it to make it so that when any player steps on it, the GUI shows up for all players? I've tried putting the GUI in StarterGui and it doesn't work.
local debounce = false script.Parent.Touched:connect(function(hit) if not debounce then debounce = true local player = game.Players:GetPlayerFromCharacter(hit.Parent) local players = game.Players:GetChildren() for i=1,#players do players[i].PlayerGui.CapGui.BeingCapped.Text = "Blue Noobs base is being captured!" end for a=1,100 do wait(0.2) for i=1,#players do players[i].PlayerGui.CapGui.CapPercentage.Text = a.. "%" players[i].PlayerGui.CapGui.CapAnimation.Size = UDim2.new(0, a, 0, 30) end end for i=1,#players do players[i].PlayerGui.CapGui.BeingCapped.Text = "Blue Noobs base has been captured!" end debounce = false end end)
If this answered your Question, Please remember to Plus 1 Vote and Submit as Answer!