So im trying to make an Admin Only GUI that will affect a certain block within my game. The problem im having is im trying to have a textbox with an inputted text, then upon pressing the button beside it, the color of the block will change. However, It does not.
What ive done: - Placed a Color3 Value within the part - Have a local script with the following code in the button:
script.Parent.MouseButton1Click:Connect(function() local rep = game:GetService("ReplicatedStorage") local text = script.Parent.Parent.Text local value = workspace.RenderedVisualiserPart.ColorValue rep.ColorRemote:FireServer(script.Parent.Parent.Text) value.Value = Color3.fromRGB(text) end)
I have a remote within ReplicatedStorage called "ColorRemote" The remote is fired by the click, then sent to the following code
ReplicatedStorage.ColorRemote.OnServerEvent:Connect(function(Player,SupportedArgument) for i,v in pairs(AllowedUserIds) do if Player.UserId ~= v then else while true do wait(0.1) local text = game.StarterGui.AdminPanel.AdminGUI.MainFrame.Color.Text local colorValue = workspace.RenderedVisualiserPart.ColorValue colorValue.Value = Color3.fromRGB(text) --local colorval = game.StarterGui.AdminPanel.AdminGUI.MainFrame.Color.Text -- local visPart = workspace:FindFirstChild("RenderedVisualiserPart") workspace.RenderedVisualiserPart.Color = colorValue.Value end end end end)
After trying numerous ways to potentially do this, the text from the "Textbox" does not get sent to the Color3Value I have to be able to change the Part color. If you are able to help, please do. If you need more details, Send me a friend Request on Discord. My Tag is: Oblivion?#0003
Thanks!
For an easier version, how can I turn the text value into the RGB. Since
Color3.fromRGB(text)
wouldnt work
To send a certain color to the server, you need to send it through your RemoteEvent. In your Server Script, you have the brick go to the same color it's already set to. local text = game.StarterGui.AdminPanel.AdminGUI.MainFrame.Color.Text
, anything that happens through the client stays on the client unless it's sent to the server through a RemoteEvent.
You'll need to make changes accordingly to make the scripts below work with your system.
--Made By MillerrIAm script.Parent.MouseButton1Click:Connect(function() local rep = game:GetService("ReplicatedStorage") local Color2ChangeTo = Color3.fromRGB(255,0,0) rep.ColorRemote:FireServer(Color2ChangeTo) end)
--Made By MillerrIAm ReplicatedStorage.ColorRemote.OnServerEvent:Connect(function(Player,Color) for i,v in pairs(AllowedUserIds) do if Player.UserId ~= v then else while true do wait(0.1) colorValue.Value = Color --Since you're sending the Color3 value through the remote event, you won't need to add the Color3.fromRGB value. I'm assuming the ColorValue is a Color3 Bool Value. end end end end)