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

Billboard label is cloning itself and not coloring correctly?[Half Solved]

Asked by
Donut792 216 Moderation Voter
5 years ago
Edited 5 years ago

ok so this script is supposed to clone a billboard gui and set it inside every player that joins and that works fine but it is coloring everyones namelabel blue (aka owner only) and it is also cloning another billboard gui in the 0,0,0 position in the game idk where i tried deleting everything in workspace and every other thing in existance in studio but it still sets there and just says PlayerName (default value) and its local only because it didnt show up server sided and i tried the whole delete everything process again with dex and still nothing it just sits there looking dumb

script:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local human = char.Humanoid or char:WaitForChild("Humanoid")
        human.NameDisplayDistance = 0
        local gui = script.NameLabel:Clone()
        local label = gui.Player
        label.Text = player.Name
        label.TextColor3 = Color3.new(0/255,0/255,255/255)
        gui.Parent = char
        human.DisplayDistanceType = "None"
        if player.UserId == 38270341 then
            label.TextColor3 = script.Parent.Script.Owner.Value
        elseif player.UserId == 291995028 or player.UserId == 131541716 or player.UserId == 41163273 or player.UserId == 291995028 then
            label.TextColor3 = script.Parent.Script.Admin.Value
        elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,5665608) then
            label.TextColor3 = script.Parent.Script.VIP.Value
        else
            label.TextColor3 = Vector3.new(0/255,0/255,0/255) -- sad attempt to fix the color issue
        end
    end)
end)-

1 answer

Log in to vote
2
Answered by
seith14 206 Moderation Voter
5 years ago
Edited 5 years ago

It's Color3 not Vector3, Try this I've changed it to 100,100,100 fromRGB. This should work

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local human = char.Humanoid or char:WaitForChild("Humanoid")
        human.NameDisplayDistance = 0
        local gui = script.NameLabel:Clone()
        local label = gui.Player
        label.Text = player.Name
        label.TextColor3 = Color3.fromRGB(100,100,100)
        gui.Parent = char
        human.DisplayDistanceType = "None"
        if player.UserId == 38270341 then
            label.TextColor3 = script.Parent.Script.Owner.Value
        elseif player.UserId == 291995028 or player.UserId == 131541716 or player.UserId == 41163273 or player.UserId == 291995028 then
            label.TextColor3 = script.Parent.Script.Admin.Value
        elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,5665608) then
            label.TextColor3 = script.Parent.Script.VIP.Value
        else
            label.TextColor3 = Color3.fromRGB(100,100,100) -- Fixed Color
        end
    end)
end)-
Ad

Answer this question