Animate Text Label for Overhead GUI

local label = script.Parent
local Player = game:GetService("Players")
local Teams = game:GetService("Teams")

local function Typewrite(String)

	for Count = 1, #String do

		label.Text = string.sub(String, 1, Count)

		task.wait(0.1)

	end

end
while true do
	for _, player in pairs(Player:GetPlayers()) do
		if player.Name == "robloxjw02" then
			Typewrite("Development Team")
			wait(3)
		else
			if player.Team == Teams["Army Special Operations Command"] then
				Typewrite("Army Special Operations Command")
				wait(3)
			elseif player.Team == Teams["Basic Training"] then
				Typewrite("Basic Training")
				wait(3)
			elseif player.Team == Teams["Forces Command"] then
				Typewrite("Forces Command")
				wait(3)
			elseif player.Team == Teams["Training and Doctrine Command"] then
				Typewrite("TRADOC")
				wait(3)
			elseif player.Team == Teams["Headquarters"] then
				Typewrite("Headquarters")
				wait(3)
			elseif player.Team == Teams["Jailed"] then
				Typewrite("Jailed")
				wait(3)
			elseif player.Team == Teams["Military Police"] then
				Typewrite("Military Police")
				wait(3)
			elseif player.Team == Teams["United States Army"] then
				Typewrite("United States Army")
				wait(3)
			else
				Typewrite("Visitors")
				wait(3)
			end
		end
	end
end

The error is when there is two players on different team, I see my overhead with typewrite of my team and their team, and same to them, they see their own overhead with my team and their team . What I want is we only see our own respective team on our overhead, so I see my head is my team and I see on their head is their team, same to them. Please give me solution thank you, appreciate it a lot!

1 Like

So I just had to say this first, instead of doing an elseif statement all the time couldn’t you just do Typewrite(the team or whatever the player is on) so you don’t have to copy paste everything.
Like just in any way make it run automatically so you don’t have all that code.

Well some teams i make abbreviate the Typewrite… like you can see Training and Doctrine Command, I make TRADOC

1 Like

Okay, maybe you could add a table and check if the team is in there then Typewrite(table[team]) or something. Sorry if I just commented something that wasn’t really what you asked btw.

You can make local script that hides others gui