How to search for a specific team

  1. What do you want to achieve? So I want to make it so that players in a specific team get special perks. (If I am in the runner team I get more speed)

  2. What is the issue? the code I made doesn’t work and I do not know why

  3. What solutions have you tried so far? I have made this so far
    local Player = game:GetService(“Players”).LocalPlayer
    local Team = game:GetService(“Teams”)

While true do — continuously checks to see the team
if Player.Team == (“Runner”) then
– My code
end
end

I am pretty new to Lua and I couldn’t find the answer I was looking for in other posts. I am sorry if there is an obvious solution to this.

You can just check the players team whenever they respawn if you wanna apply character modifications such as a speed boost.

Code sample which would change the walkspeed of anyone who spawns on the “Red Team” to 20, you would put it in a normal script preferably in ServerScriptService.
local Players = game:GetService(“Players”)
local Teams = game:GetService(“Teams”)

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		if Player.Team == Teams["Red Team"] then
			Character.Humanoid.WalkSpeed = 20
		end
	end)
end)