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 so the color is put onto the model with the correct coding.
What is the issue? Include screenshots / videos if possible!
Say I want the color of the model, to be white so I put 255, 255, 255 but it inserts as 0, 255, 255.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried looking for solutions, but I couldnât find anything that had the same issue.
Local Script
local Event = game.ReplicatedStorage:WaitForChild('ColorChange')
script.Parent.MouseButton1Click:Connect(function()
Event:FireServer(script.Parent.Parent.RBOX.Text, script.Parent.Parent.GBOX.Text, script.Parent.Parent.BBOX.Text)
end)
ServerScript
local Event = game.ReplicatedStorage:WaitForChild("ColorChange")
local player = game:GetService("Players").PlayerAdded:Wait()
Event.OnServerEvent:Connect(function(R, G, B)
player.Character.Tool.Handle.Color = Color3.fromRGB(R, G, B)
end)
Local script looks good. If you are only getting 2 of the three colors, its because you were assigning R to the player who sent the event, and that was on server.
So just change the line I gave you for the server code, and it should work
local Event = game.ReplicatedStorage:WaitForChild('ColorChange')
script.Parent.MouseButton1Click:Connect(function()
Event:FireServer(game.Players.LocalPlayer, script.Parent.Parent.RBOX.Text, script.Parent.Parent.GBOX.Text, script.Parent.Parent.BBOX.Text)
end)
ServerScript
local Event = game.ReplicatedStorage:WaitForChild("ColorChange")
local player = game:GetService("Players").PlayerAdded:Wait()
Event.OnServerEvent:Connect(function(player, R, G, B)
player.Character.Tool.Handle.Color = Color3.fromRGB(R, G, B)
end)
When you fire an event from the client, to the server, you never have to Send the player event to the server, but the server always needs to Receive the player