Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

teambinding billboard gui, can you help?

i would like to teambind this. so if someone joined a team it would run this script please help im losing my mind. Basically want I want is like if player is on a certain team it will run the script.

e.g if player is on team”red” then Run script End)

local User = script:WaitForChild("Username")
local Rank = script:WaitForChild("Rank")
local Regiment = script:WaitForChild("Regiment")

game.Players.PlayerAdded:connect(function(Player)
	Player.CharacterAdded:connect(function(Character)
		spawn(function()
			wait(.8)
			local c = User:clone()
			local a = Rank:clone()
			local b = Regiment:clone()
			a.Adornee = Character:WaitForChild("Head")
			a.TextLabel.Text = Player:GetRoleInGroup(4887489)
			a.Enabled = true
			a.Parent = Character
			b.Adornee = Character:WaitForChild("Head")
			b.TextLabel.Text = Player:GetRoleInGroup(9959171)
			b.TextLabel.TextColor3 = (Player.TeamColor.Color)
			b.Enabled = true
			b.Parent = Character
            c.Adornee = Character:WaitForChild("Head")
			c.TextLabel.TextColor3 = (Player.TeamColor.Color)
			c.TextLabel.Text = Player.Name
			c.Enabled = true
			c.Parent = Character
			Character:WaitForChild('Humanoid').NameOcclusion = Enum.NameOcclusion.OccludeAll
			local h = Character.Head:Clone()
			local m = Instance.new('Model',Character)
			m.Name = 'NameTag'
			h.Parent = m
			Character.Head:WaitForChild('face'):Destroy()
			Character.Head.Transparency = 1
			local w = Instance.new('Weld',Character.Head)
			w.Part0, w.Part1 = Character.Head, h
		end)
	end)
end)

1 comment

0

And the first answer didn’t work all it does is say that I’m a guest on both groups

1 answer

local User = script:WaitForChild("Username")
local Rank = script:WaitForChild("Rank")
local Regiment = script:WaitForChild("Regiment")

game.Players.PlayerAdded:connect(function(Player)
    Player.CharacterAdded:connect(function(Character)
        spawn(function()
            wait(.8)
		if player.Team.TeamColor == 'COLOR_WANTED' then -- sees if player is on the team. (forgot how to use teams but i think it something like this)
            local c = User:clone()
            local a = Rank:clone()
            local b = Regiment:clone()
            a.Adornee = Character:WaitForChild("Head")
            a.TextLabel.Text = Player:GetRoleInGroup(4887489)
            a.Enabled = true
            a.Parent = Character
            b.Adornee = Character:WaitForChild("Head")
            b.TextLabel.Text = Player:GetRoleInGroup(9959171)
            b.TextLabel.TextColor3 = (Player.TeamColor.Color)
            b.Enabled = true
            b.Parent = Character
            c.Adornee = Character:WaitForChild("Head")
            c.TextLabel.TextColor3 = (Player.TeamColor.Color)
            c.TextLabel.Text = Player.Name
            c.Enabled = true
            c.Parent = Character
            Character:WaitForChild('Humanoid').NameOcclusion = Enum.NameOcclusion.OccludeAll
            local h = Character.Head:Clone()
            local m = Instance.new('Model',Character)
            m.Name = 'NameTag'
            h.Parent = m
            Character.Head:WaitForChild('face'):Destroy()
            Character.Head.Transparency = 1
            local w = Instance.new('Weld',Character.Head)
            w.Part0, w.Part1 = Character.Head, h
	end -- ends new line
        end)
    end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.