✓ Accepted answer
All you have to do is send a command as the first argument in the call, and use a variadic function to include any other arguments (in this case, the colour). As an example:
Server-Side
local remote = Instance.new('RemoteFunction', game:GetService('ReplicatedStorage'));
remote.Name = 'Utility';
local part = workspace.WhateverThePartIs;
remote.OnServerInvoke = function(player, command, ...)
local args = {...}
if command == 'colour' then
local colour = args[1]
if type(colour) == 'string' then
part.BrickColor = BrickColor.new(colour);
end;
end;
end;
Local
local remote = game:GetService('ReplicatedStorage'):WaitForChild('Utility');
remote:InvokeServer('colour', 'Really red');
Really, that should be all there is to it. Here are some links, I recommend you read up on what was used in this example so you can fully understand it. Hope this helped!
Remotes,
Variadic Functions,
BrickColor
1 comment
Ty for your help.