Hi guys I'm trying to change the colour of a block by selecting creating a colour on a Gui, I have a script parented to the part I'm wanting to effect:
local players = game:GetService("Players")
players.PlayerAdded:connect(function (player)
wait(1) --this is just to let the player load, it'll be cleaner when im done haha
local p_colour = require(player.PlayerGui.Gui.TextButton.ModuleScript).colour()
print(p_colour)
script.Parent.Color = Color3.new(p_colour)
end)
And the module script it is referring to is:
local _M = {}
function _M.colour(p_colour)
p_colour = script.Parent.BackgroundColor3
print(p_colour)
return(p_colour)
end
return _M
both of the print value out put the correct Color3 value (255,51,93) but the effected part always changed to black (0,0,0).
I've been trying to fix this for ages and it's probably something stupid that i'm missing...
Thanks for your time!

5 comments
Is the first script a local script? And explain, in detail, what you're trying to do. BTW, ModuleScripts can only be called once in one script.
I'm trying to make it so that the player can cutomise the colours of certain furniture parts by selecting a colour on a Gui, at the moment I'm simply using the backgound of a Gui button as the colour to try and make it work. I have the 1st script inside the part which should have it's colour changed and the module script inside the gui button (with the background colour that i'm trying to copy)
If the
.color()returns a color3, you can remove the Color3.new() on line 6Perfect, that fixed the problem, thakn you very much for the help!
You don't require the
Color3.new. :)