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

Help me with this script?[SOLVED]

Asked by
steev 0
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
0
Answered by
ultrabug 306 Moderation Voter
10 years ago

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
0
Where would this be in the script to make it function properly? steev 0 — 10y
0
Anywhere betweeen lines 5-11 I would just put it after line 10. ultrabug 306 — 10y
Ad

Answer this question