【发布时间】:2021-04-15 04:48:49
【问题描述】:
我想让玩家在第一次加入名为RedTeam 的团队时看到来自textlabel 的文字,团队颜色为Really Red,前提是他们具有正确的组排名(队长)。我怎样才能做到这一点?
这是我尝试过的:
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
game.Teams.Redteam.PlayerAdded:Connect(function(player)
script.BillboardGui.Frame.Visible = true
print(player.Name .. " joined the game!")
local groupId = "Captain"
local guiClone = script.BillboardGui:Clone()
guiClone.Parent = character.Head
local textlabel = guiClone.Frame.TextLabel
local groupRank = player:GetRoleInGroup(groupId)
textlabel.Text = groupRank
end)
end)
end)
【问题讨论】: