I have a notification system but there are a few problems. It prints 0 to the output till I press the button that triggers the event. It then prints 1 once, and doesn't print anything after that. Thanks in advance for your help on fixing my problem.

local messages = {}

game.ReplicatedStorage.Notification.OnClientEvent:Connect(function(message)
	table.insert(messages, #messages + 1, message)
end)

while true do
	wait()
	print(#messages)
	for _, message in pairs(messages) do
		script.Parent.TextLabel.Text = message
		script.Parent.TextLabel:TweenPosition(UDim2.new(0.349, 0, 0, 0), "Out", "Quad", 1)
		wait(3)
		script.Parent.TextLabel:TweenPosition(UDim2.new(0.349, 0, -5, 0), "Out", "Quad", 1)
		table.remove(messages, 1)
	end
end

2 comments

0

any errors?

0

No errors