while wait(1) do
local Player = game:GetService("Players").LocalPlayer.Character
mushycolour = script.Parent
script.Parent.MouseButton1Click:connect(function()
Player.Body.Model.Mushroom.Color3 = Color3.new(mushycolour.ImageColor3)
end)
end
while wait(1) do
local Player = game:GetService("Players").LocalPlayer.Character
mushycolour = script.Parent
script.Parent.MouseButton1Click:connect(function()
Player.Body.Model.Mushroom.BrickColor = BrickColor.new(ColorHere)
end)
end
Hmmmmm That wont work? Thanks anyways
Ohhhhhh i just red the script and i want it to get the image GUI colour, then change the parts colour.
You have to change the color to what you want
Yeah but im using a colour wheel. So is there no way i can fetch the image colour then use that?
Hello, sorry for the wait
you would replace that with this: Player.Body.Model.Mushroom.ImageColor3 = Color3.new(ColorHere)
Thank you but shall it work if I used a Variable in the “ColorHere” Section?
Yeah that will work, just make sure to do Color3.new() when you are equating the variable
Thank you, but i’m trying to
When a player uses the colour wheel it changes the DisplayColor to the colour they chose.
My script, (Below) repeats itself every 1 second, and changes my players colour depending on the colour the player chose.
while wait(1) do
local Player = game:GetService("Players").LocalPlayer.Character
local mushycolour = script.Parent.ImageColor3 -- displaycolor image
script.Parent.MouseButton1Click:connect(function()
Player.Body.Model.Mushroom.Color = Color3.new(mushycolour) -- my variable will not work here for some reason.
end)
end
Hello, I don’t think it is possible to make a color wheel without it being advanced, but I know how to make a text color changer
mushycolor is an object of Type Color3 , So Color3.new(mushycolour)
can be replaced with
mushycolor
. However the script can cause memory leak since you are creating a new connection every one second , this can create lag for the client.
I would do Color3.FromRGB
and then use the color picker to choose my color
Hello! Thank you! I have it all figured out now, And mushycolour was my variable.
There is a way to fix this, when the player chooses it, it does it when necessary, not every 1 second
Also, how could i not create lag for my client?
I agree with @Friendly4Crafter. If you use “Color3.new” you would generally have to divide each value by 255 since it takes any value between 0-1. You should use Color3.fromRGB for this.
Thank you guys all for the help!
I (Somehow) managed to get it working, (Probably Lags my client because I set it to run it every third of a second)
But i guess if you want to see it work, Bobble [BETA] - Roblox
Me after realising it doesn’t work on mobile-
I recommend removing the while loop since you’re using an event too. Every time the button is clicked, the color will change. Even removing the while loop, the color will still change.
local Player = game:GetService('Players').LocalPlayer.Character
mushycolour = script.Parent
script.Parent.MouseButton1Click:Connect(function()
Player.Body.Model.Mushroom.Color = Color3.fromRGB(255, 255, 255)
end)