I'm trying to make a script where a Billboard GUI tags you when you die. Of course, it has to be visible only to the specified team.
I can understand what it's saying but I do not know where to start editing. Would I replace the "local group_id" with the team color/name?
local players = game:GetService('Players')
local group_id = 1
local gui = Instance.new("BillboardGui")
gui.Size = UDim2.new(2,0,2,0)
gui.StudsOffset = Vector3.new(0,1,0)
gui.AlwaysOnTop = true
local label = Instance.new("ImageLabel")
label.Image = "rbxassetid://819434834"
label.Size = UDim2.new(0,100,0,100)
label.Size = UDim2.new(1,0,1,0)
label.Position = UDim2.new(0,0,-0.5,0)
label.BackgroundTransparency = 1
label.Parent = gui
local players_allowed = {
player2 = true;
player1 = true;
['spaced name'] = true;
}
local function player_joined(player)
player.CharacterAdded:connect(function(character)
if player:IsInGroup(group_id) or players_allowed[player.Name:lower()] then
local gui_clone = gui:Clone()
local head = character:WaitForChild("Head")
gui_clone.Parent = player:WaitForChild("PlayerGui")
delay(.1, function()
gui_clone.Adornee = head
end)
end
end)
end
players.PlayerAdded:connect(function(player)
player_joined(player)
end)
for i,v in pairs(players:GetPlayers()) do
player_joined(v)
end

1 comment
Hmm... Doesn't seem to work. Do I place it in workspace, starter Gui?