Animate Text Label for Overhead GUI

Can anyone help how to make this code into based on team? (This is animated typewrite for my overhead billboard textlabel):
If i make like this , without based on team, it works:

local label = script.Parent

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

	Typewrite("Military Police")

	task.wait(3)

	Typewrite("SRT")

	task.wait(3)

end

But once I try to make it based on team, it doesn’t work, please solution for this?
This is the code that doesn’t work, I want to make it work based on team :

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
	if Player.Team == Teams["Military Police"] then
		Typewrite("Military Police")

		task.wait(3)

		Typewrite("SRT")

		task.wait(3)
	end
end

**

NOTE : I use Normal Script (Server Script Service)

**
Really need the solution

image
When you call player, you are only referencing the service, not the actual player.

So how to call the player? I need the solution

Do i have to add player:GetPlayers()?

Yes, use game:GetService('Players'):GetPlayers() and run a loop through each player in the table. Then you have the needed Player variable you want for your function.

So I assume I should make like this?

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.Team == Teams["Military Police"] then
			Typewrite("Military Police")

			task.wait(3)

			Typewrite("SRT")

			task.wait(3)
		end
	end
end

Like this??

Yeah this is right, thank you!

The module you’re using must only work with local scripts. That or you were incorrectly placing server scripts.