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

BackgroundColor3 WEIRD glitch fix?

Asked by 6 years ago

So uh... is this a studio bug? I'm trying to work with BackgroundColor3 to make it change a different color with Instance.new(). I look at the color because it won't change and it looks like this...

Picture!

Idk how to fix this at all. Here's the update function that I'm using to do this.

function update()
    for i,v in pairs(game.Players:GetChildren())do
        if playerList:FindFirstChild(v.Name) then playerList[v.Name]:Destroy() else
            local newPlayer = Instance.new("TextButton")
            newPlayer.Name = v.Name
            newPlayer.Text = v.Name
            newPlayer.Font = "SourceSansItalic"
            newPlayer.BorderSizePixel = 0
            newPlayer.BackgroundColor3 = Color3.new(211,211,211) --here is where I change backgroundcolor3
            newPlayer.TextScaled = true
            newPlayer.Parent = playerList
            newPlayer.MouseButton1Click:Connect(function()
                newPlayer.BackgroundColor3 = Color3.new(85, 0, 255)

            end)
        end
    end
end

1 answer

Log in to vote
0
Answered by
PlaasBoer 275 Moderation Voter
6 years ago

Use Color3.fromRGB()

Example i changed from your code.

newPlayer.BackgroundColor3 = Color3.fromRGB(211,211,211)

Read more https://wiki.roblox.com/index.php?title=API:Color3

0
Oh... thanks! Sharkeedub 179 — 6y
0
thnks for that Jefureiku 0 — 6y
Ad

Answer this question