I am wondering how I can log everyone in a specific team. The players on that team will be sent through a discord webhook to a discord channel.
How would I add commas and stuff? Additionally, how would I list the player’s name?
Would I change game.Players:GetChildren to the.team:GetChildren?
You could use Team:GetPlayers()
to retrieve all the members of a specific team.
And like @4vials stated, you will need to use a proxy (many are free) in order to use Discord webhooks, due to Discord blocking webhook requests from Roblox games.
Question., How would I get everything inside of the table, though.
local teams = game:GetService("Teams")
local team = teams.Team --Example team.
team.PlayerAdded:Connect(function(player) --fires whenever a player joins the team
print(player.Name.." has joined the team.")
--Discord webhook here.
end)
team.PlayerRemoved:Connect(function(player) --fires whenever a player leaves the team
print(player.Name.." has left the team.")
--Discord webhook here.
end)
Here’s an example which you could make use of, it utilises the available “.PlayerAdded” and “.PlayerRemoved” events of team instances.
https://developer.roblox.com/en-us/api-reference/event/Team/PlayerAdded
https://developer.roblox.com/en-us/api-reference/event/Team/PlayerRemoved
1 Like