I have a bug that is pretty much dumb

i have a bug that is pretty much dumb

-- Reference to your TextLabel
local textLabel = script.Parent.Parent.TextLabel

-- Initialize variables
local text = "This Can Take A While" -- The initial text
local maxDots = 3 -- Maximum number of dots before reset
local currentDots = 0 -- Current number of dots
local interval = 1 -- Time interval in seconds

-- Function to update the text
local function updateText()
	textLabel.Text = text .. string.rep(".", currentDots)
	currentDots = (currentDots + 1) % (maxDots + 1)
end

-- Create a timer to update the text every second
local shirts = game.ReplicatedStorage:WaitForChild("Shirts")

while true do
	wait(interval)
	updateText()
end

shirts.OnClientEvent:Connect(function()
	textLabel.Visible = false
end)

for some reason when the event is called the “shirts.OnClientEvent:Connect(function() textLabel.Visible = false end)” just doing nothing

If this is a gui, you need to change it on playergui

What i mean is , if the gui is in replicatedstorage or starter gui, you need to change the gui from the player’s playergui

like this?

-- Reference to your TextLabel
local textLabel = game.Players.LocalPlayer.PlayerGui.shirts.ImageLabel.TextLabel

-- Initialize variables
local text = "This Can Take A While" -- The initial text
local maxDots = 3 -- Maximum number of dots before reset
local currentDots = 0 -- Current number of dots
local interval = 1 -- Time interval in seconds

-- Function to update the text
local function updateText()
	textLabel.Text = text .. string.rep(".", currentDots)
	currentDots = (currentDots + 1) % (maxDots + 1)
end

-- Create a timer to update the text every second
local shirts = game.ReplicatedStorage:WaitForChild("Shirts")

while true do
	wait(interval)
	updateText()
end

shirts.OnClientEvent:Connect(function()
	textLabel.Visible = false
end)

Do you fire the RemoteEvent on the player (locally) (show how you fire the event)

You have an infinite loop here; code below this loop will not run. You have two options:

  1. Move the OnClientEvent above the loop
  2. Place the loop inside a coroutine or wrap it using task.spawn or task.defer

i figured it out but i have an off topic question