How to call a players team in a script(not local) thats not playeradded

hi everyone so here is the problem i have a script but i need to check all players in the server s team like 1 is a monster and othe others are humans but there is a wait(24 ) before the script that i cant move for now cuz that makes it so i will have to rewrite the whole game after the 24 sec it chechs if players team is human or monster and it does the part of the script that is called for the team the script is in serverscript service if you need more info let me know

1 Like
for i,v in pairs(game.Players:GetPlayers()) do
	if v.Team then
		print(v.Team)
	end
end

If this answers your question, please mark this as a solution.

1 Like

holy heck dude thanks that was very simple to do iv been trying to fix this script for a week now everyone else who helped in my prev post about this wsnt able to help thanks for ya time and have a nice day

2 Likes

If you’re referring to this thread then this & that thread are completely different.

If you need to get a team’s players you should call the :GetPlayers() instance method on that team instance.

https://developer.roblox.com/en-us/api-reference/function/Team/GetPlayers

2 Likes

No problem! If that helped you out, please make sure to mark is as a solution.