You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want it to make it so the player can choose any RGB color for the tool.
What is the issue? Include screenshots / videos if possible!
The color won’t change for some reason.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have, and I tried looking for videos but it didn’t work.
Local Script
local Event = game.ReplicatedStorage:WaitForChild('ColorChange')\
script.Parent.MouseButton1Click:Connect(function()
Event:FireServer()
end)
Server Script
local Event = game.ReplicatedStorage:WaitForChild("ColorChange")
local player = game:GetService("Players").PlayerAdded:Wait()
local frame = player.PlayerGui:WaitForChild("ScreenGui").Frame
Event.OnServerEvent:Connect(function()
player.Character.Tool.Handle.Color = Color3.fromRGB(frame.RBOX.Text, frame.GBOX.Text,frame.BBOX.Text)
end)
Are there any errors in pathing a variable or something else? Also I suggest using tonumber() in case someone put like “w” for R instead of a number tonumber(frame.RBOX.Text)
You have to pass R, G, and B values through the remote event as the PlayerGui doesn’t replicate. You should also restrict entering letters or numbers above 255 to prevent breaking.
Put the frame text inside of the fire server, then you can get it through the other end. Example: FireServer(frame.RBOX.Text, frame.GBOX.Text,frame.BBOX.Text) then OnServerEvent(R,G,B) make sure to add local variables for the frame son the client.