How can I add a color3 changer?

So I have this script where it will show a text with what you fireClient with but how can I add a color3 part? So I can put color 3 and the color fo the text label will be the color choosen? This is the FireClient which allows me to input text:

game.ReplicatedStorage.EditGUI:FireClient(Player,“text”,“MessageGoesHere”)

this is the Handler for the gui:

game.ReplicatedStorage.EditGUI.OnClientEvent:Connect(function(type,value)

    if type == "text" then

    script.Click:Play()

    local example = script.Parent.Example:Clone()

    example.Parent = script.Parent

    example.Visible = true

    example.Text = value

    for i,v in pairs(script.Parent:GetChildren()) do

    if v.Name == "MoveUp" then

    game:GetService("TweenService"):Create(v,TweenInfo.new(0.3,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Position = UDim2.fromScale(0.5,v.Position.Y.Scale-0.05)}):Play()

    end

    end

    example.Name = "MoveUp"

    game:GetService("TweenService"):Create(example,TweenInfo.new(0.3),{TextTransparency = 0, TextStrokeTransparency = 0}):Play()

    wait(4)

    game:GetService("TweenService"):Create(example,TweenInfo.new(0.7),{TextTransparency = 1, TextStrokeTransparency = 1}):Play()

    wait(1)

    example:Destroy()

    end

    end)

If I’m understanding this correctly, you want to change the color of the text? If that’s the case, try giving this a read: TextBox | Roblox Creator Documentation

2 Likes

Ive read thorught it but how can I do it so I add the Color3 Value in the part where it fires the event?

Can you add another parameter, like:

game.ReplicatedStorage.EditGUI:FireClient(Player,“text”,“MessageGoesHere”,textColor)

And then use that to set the text color in the receiving script?

1 Like

What would I put in the receiving script: This is what the sending script looks like:

local Players = game:GetService("Players")

script.Parent.Activated:Connect(function()

local Player = Players:GetPlayerFromCharacter(script.Parent.Parent)

game.ReplicatedStorage.Remotes.Message.MessageEdit:FireClient(Player,"text","ColorTest!!",0, 255, 200)

end)

you would not send each individual color code do what indefinite did

textColor

which should be the property of the text

so the object.textColor

What does that mean. I didnt understand?

I believe it would be something like this.
Sending Script:

local Players = game:GetService("Players")

script.Parent.Activated:Connect(function()

	local Player = Players:GetPlayerFromCharacter(script.Parent.Parent)

	game.ReplicatedStorage.Remotes.Message.MessageEdit:FireClient(Player,"text",Color3.new(0, 255, 200))

end)

Receiving Script:

game.ReplicatedStorage.EditGUI.OnClientEvent:Connect(function(type,value,color)

	if type == "text" then

		script.Click:Play()

		local example = script.Parent.Example:Clone()

		example.Parent = script.Parent

		example.Visible = true

		example.Text = value
		
		example.TextColor3 = color

		for i,v in pairs(script.Parent:GetChildren()) do

			if v.Name == "MoveUp" then

				game:GetService("TweenService"):Create(v,TweenInfo.new(0.3,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Position = UDim2.fromScale(0.5,v.Position.Y.Scale-0.05)}):Play()

			end

		end

		example.Name = "MoveUp"

		game:GetService("TweenService"):Create(example,TweenInfo.new(0.3),{TextTransparency = 0, TextStrokeTransparency = 0}):Play()

		wait(4)

		game:GetService("TweenService"):Create(example,TweenInfo.new(0.7),{TextTransparency = 1, TextStrokeTransparency = 1}):Play()

		wait(1)

		example:Destroy()

	end

end)

Try that, unless I didn’t understand correctly

2 Likes

either pre-set a dictionary or fetch the textColor

local dictionary= {
r=0,
g=255,
b=200

}

then send the dictionary to the receiver.
then when you want to use it use the

.color3fromrgb(dictionary.r,dictionary.g,dictionary.b)

do not copy and paste it is not formatted correctly

1 Like

Isn’t that the same as saying Color3.new(0,255,200)

But where would I put my text?

1 Like

not sure tbh, I never fired with making color3.new() and then using its contents or setting color = to it.

1 Like

im not sure i understand what you’re talking about? you put your text as a parameter or set text == the target text

2 Likes

You mean like, where you would set the value of it? There’s already a line for that (example.Text = value)

Yeah I noticed. I didnt notice it at first my bad

1 Like

No worries, let me know how it goes

1 Like

works pretty good!

1 Like

Awesome! Good luck with your projects in the future.

1 Like