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

I Cant Set Color3Value's Value?

Asked by 5 years ago

So, i am creating a script that lets you change the "theme" of the gui. I cant seem to figure out how to set a color3value's value so that my script can change the ui.

Here is the script that im trying to get to set the value.

on = false
vax = script.Parent.Parent.Parent.Parent
section = vax.section
box = vax.box
sectiontext = vax.sectiontext
boxtext = vax.boxtext
enabledtext = vax.enabledtext

script.Parent.MouseButton1Click:Connect(function()
    if on == false then
        script.Parent.TextColor3 = Color3.fromRGB(enabledtext)
        on = true
    else
        warn("ERR_#001 - | Non-Lethal | UI Is not togglable")
        on = true
    end
end)

function toggleOn()
    section.Value = Color3.new(0,0,0)
    box.Value = Color3.new(28,28,28)
    sectiontext.Value = Color3.new(255,255,255)
    boxtext.Value = Color3.new(0,0,0)
    enabledtext.Value = Color3.new(28,28,28)
end

function toggleOff()

end

while wait() do
    if on == true then
        toggleOn()
        break
    else
        toggleOff()
        break
    end 
end

here is the code that auto-updates it ig you could say

vax = script.Parent
section = vax.section.Value
box = vax.box.Value
sectiontext = vax.sectiontext.Value
boxtext = vax.boxtext.Value
enabledtext = vax.enabledtext.Value

while wait() do

    vax.Mods.BackgroundColor3 = Color3.new(section.r, section.g, section.b)
    vax.Admins.BackgroundColor3 = Color3.new(section.r, section.g, section.b)
    vax.Owners.BackgroundColor3 = Color3.new(section.r, section.g, section.b)

    vax.Mods.box.BackgroundColor3 = Color3.new(box.r, box.g, box.b)
    vax.Admins.box.BackgroundColor3 = Color3.new(box.r, box.g, box.b)
    vax.Owners.box.BackgroundColor3 = Color3.new(box.r, box.g, box.b)

    vax.Mods.TextColor3 = Color3.new(sectiontext.r, sectiontext.g, sectiontext.b)
    vax.Admins.TextColor3 = Color3.new(sectiontext.r, sectiontext.g, sectiontext.b)
    vax.Owners.TextColor3 = Color3.new(sectiontext.r, sectiontext.g, sectiontext.b)

    ch1 = vax.Mods.box:GetChildren()
    ch2 = vax.Admins.box:GetChildren()
    ch3 = vax.Owners.box:GetChildren()
    for i,v in pairs(ch1, ch2, ch3) do
        if v[1]:IsA("TextButton") then
            v.TextColor3 = Color3.new(boxtext.r, boxtext.g, boxtext.b)
        end
        if v[2]:IsA("TextButton") then
            v.TextColor3 = Color3.new(boxtext.r, boxtext.g, boxtext.b)
        end
        if v[3]:IsA("TextButton") then
            v.TextColor3 = Color3.new(boxtext.r, boxtext.g, boxtext.b)
        end
        break
    end

end

I dont know much about lua, so i hope i can get some help! :)

0
Can you show me a picture of your Explorer, so I'll know what I'm working with? thesit123 509 — 5y
0
https://i.vgy.me/ht9LDT.png - Here, and incase you wanted to know. Its a staff utility gui for mods, admins, and owners. valistic5 15 — 5y

Answer this question