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

Help me with this script?[SOLVED]

I know how the text works and everything. All i want to do is change the colour of the background on the gui not the text generated. I also want to change the transparency of the background.

Leave the text i just want the gui background colour and transparency changed.

I want to know where it will be put in the script.

function NewGui()
    local Gui = Instance.new("ScreenGui")
    Gui.Name = "Countdown Gui"
    local Text = Instance.new("TextLabel",Gui)
    Text.Name = "Countdown"
    Text.Size = UDim2.new(0.2,0,0.1,0) --Adjust size 
    Text.Position = UDim2.new(0,0,0,0) --Adjust position if wanted.
    Text.TextColor3 = Color3.new(224, 0, 0) --Change the  text color
    Text.TextTransparency = 0.5 --Change the text transparency
    Text.FontSize = 7 --The size of the text (9 is the highest)
    return Gui
end
script.Parent.Touched:connect(function(Part)
    local Player = Game:GetService("Players"):GetPlayerFromCharacter(Part.Parent)
    if Player and not Player.PlayerGui:FindFirstChild("Countdown Gui") then
        local Gui = NewGui()
        Gui.Parent = Player.PlayerGui
        for i=90,0,-1 do
            Gui.Countdown.Text = i
            wait(1)
        end
        Player.Character:BreakJoints()
    end
end)

1 answer

✓ Accepted answer

To change the background colour, you use the same thing as the text color except the property is BackgroundColor3 so for example it would be;

Text.BackgroundColor3=Color3.new(255, 255, 0)

and the transparency is then like this:

Text.BackgroundTransparency=0.5

2 comments

0

Where would this be in the script to make it function properly?

0

Anywhere betweeen lines 5-11 I would just put it after line 10.

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