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

Changing Gui Colour,Transparency and Text size?

Asked by
steev 0
10 years ago

How would i change the colour of the Gui in this script?

I also want to make it transparent for example 0.5. I also want to change the text size

Any help?

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.3,0,0.3,0) --Adjust size 
    Text.Position = UDim2.new(0,0,0,0) --Adjust position if wanted.
    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=30,0,-1 do
            Gui.Countdown.Text = i
            wait(1)
        end
        Player.Character:BreakJoints()
    end
end)

1 answer

Log in to vote
0
Answered by
Marolex 45
10 years ago
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.3,0,0.3,0) --Adjust size 
    Text.Position = UDim2.new(0,0,0,0) --Adjust position if wanted.
    Text.TextColor3 = Color3.new(225, 225, 225) --Change the  text color
    Text.TextTransparency = 0.5 --Change the text transparency
    Text.FontSize = 5 --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=30,0,-1 do
            Gui.Countdown.Text = i
            wait(1)
        end
        Player.Character:BreakJoints()
    end
end)

Ad

Answer this question