🎉
【Roblox開発】チームを作成しスクリプトでチームを変更する方法
はじめに
今回はチームの作り方とスクリプトからチームの変更を行う方法を共有します。
こういうやつ↓

公式Reference
実装
Teamの追加
Teamsサービスの中にTeamオブジェクトを追加


それぞれ名前と色を設定します。


変更インタラクトオブジェクト設置


コード

local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local redButton = workspace.RedPart.ProximityPrompt
local blueButton = workspace.BluePart.ProximityPrompt
redButton.Triggered:Connect(function(player)
player.Team = Teams["Red"]
end)
blueButton.Triggered:Connect(function(player)
player.Team = Teams["Blue"]
end)
PlayerオブジェクトがTeamのプロパティを持っているようです。
そのプロパティにTeams["指定のチーム名"]を代入するだけで行けろ感じです。
実行
Discussion