i am making a suitcase gui and need to set a gui background color from a script.
anyone see anything wrong here?
local config = {}
config.freeFullColorAccess = true -- Will full color be free? If yes then set to true if no then set to false.
config.gamepassIdForFullColorAccess = 0 -- If freeFullColorAccess is false then insert a gamepass id here that people must buy to use full colors! (If left at 0 freeFullColorAccess will be turned on by default!)
config.defaultColor1 = "255, 0, 0"
config.defaultColor2= Color3.fromRGB(0, 0, 255)
config.defaultColor3 = Color3.fromRGB(0, 255, 0)
config.defaultColor4 = Color3.fromRGB(255, 255, 0)
return config
and here is the real script:
local configurations = require(script.Parent.Configure)
print("1")
game.Loaded:Connect(function()
print("2")
script.Parent.AncestryChanged:Connect(function(child,Newparent)
print("3")
if game.Players:GetPlayerByUserId(Newparent.Parent.UserId) then
print("4")
local default1 = configurations.defaultColor1
print("5")
local default2 = configurations.defaultColor2
print("6")
local default3 = configurations.defaultColor3
print("7")
local default4 = configurations.defaultColor4
print("8")
local freeFullAccess = configurations.freeFullColorAccess
print("9")
local gamepassid = configurations.gamepassIdForFullColorAccess
print("10")
local plr = Newparent.Parent
print("11")
local mps = game:GetService("MarketplaceService")
print("12")
script.Parent.Frame.Default1.BackgroundColor3 = Color3.fromRGB(default1)
print("13")
script.Parent.Frame.Default2.BackgroundColor3 = default2
print("14")
script.Parent.Frame.Default3.BackgroundColor3 = default3
print("15")
script.Parent.Frame.Default4.BackgroundColor3 = default4
print("16")
if freeFullAccess == true or gamepassid == 0 then
print("17")
script.Parent.Frame.FullColors.Lock.Visible = false
print("18")
else
print("19")
if mps:UserOwnsGamePassAsync(plr.UserId,gamepassid) then
print("20")
script.Parent.Frame.FullColors.Lock.Visible = false
print("21")
else
print("22")
script.Parent.Frame.FullColors.Lock.Visible = true
print("23")
end
print("24")
end
print("25")
else
print("26")
print("Not valid player.. Waiting to be parented to a player...")
print("27")
end
print("28")
end)
print("29")
end)
it printed “1” and nothing else. lol