Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why isn't my title being placed above my character's head?

Asked by 4 years ago

The script has a BillboardGui inside that I want placed onto a player's head if they are on a certain team in-game, but it doesn't work even when I'm on the right team.

local title = script.BillboardGui
local red1 = 0
local green1 = 0
local blue1 = 0

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        if player.Team == "Security Department" then
            local newGUI = title:Clone()
            newGUI.TextLabel.TextColor3 = Color3.fromRGB(red1,green1,blue1)
            newGUI.TextLabel.Text = "Security Department"
            newGUI.TextLabel.Parent = character.Head
        end      
    end)
end)

1 answer

Log in to vote
0
Answered by 4 years ago

if player.Team == "Security Department" then a team is not a name, it's a team instance. You'd have to do player.Team == game.Teams["Security Department"]

0
I tried it, but the title still wasn't placed on the player's head ThetoughODST 5 — 4y
0
You can do this either way. Though, it doesn't change the script in any way. BiIinear 104 — 4y
Ad

Answer this question