As a Roblox Developer, It’s currently too hard to write code in the way I want, because I cannot use :FireAllClients/:FireClient to run arbitrary functions on the client-side.
If this issue is addressed, It would improve my development experience because I wouldn’t always have to use premade functions on the client, I could just send a function for the client to call.
I know that Client to Server would present security issues, But if we were to allow Server to Client it would present 0 security issues (From what I know…) and make lives easier and give ROBLOX some more flexibility than before.
If there is a reason this could present issues I’d like to know. Because I feel like this would make developers live’s easier, Albeit a small change it would still have quite a big impact.
Furthermore: Scripts like RemoteSpy doesn’t even detect :FireClient/:FireAllClients so I do not believe the exploiter could easily modify/rewrite any functions that are passed through.
A good example one why this would be incredibly useful (also pertains to my issue which prompted this) is as follows:
-- What we would be able to do if we could pass functions:
-- Server
local ReplicationEvent = Instance.new("RemoteEvent", ReplicatedStorage)
ReplicationEvent.Name = "ReplicationEvent"
function Replicate(Func)
ReplicationEvent:FireAllClients(Func)
end
Replicate(function()
local Part = Instance.new("Part", workspace)
end)
-- Client
local ReplicationEvent = ReplicatedStorage:WaitForChild("ReplicationEvent")
ReplicationEvent.OnClientEvent:Connect(function(Func)
Func() -- Would create a part for all players in the game, Good for replicating stuff without having to script a premade function for it.
end)
---------------
-- What we currently have to do
-- Server
local ReplicationEvent = Instance.new("RemoteEvent", ReplicatedStorage)
ReplicationEvent.Name = "ReplicationEvent"
function Replicate(Request)
ReplicationEvent:FireAllClients(Request)
end)
-- Client
local ReplicatedStorage = game.ReplicatedStorage
local ReplicationEvent = ReplicatedStorage:WaitForChild("ReplicationEvent")
ReplicationEvent.OnClientEvent:Connect(function(Request, Other)
if Request == "MakePart" then -- So on and so forth for every little replication we want to make.
local Part = Instance.new("Part", workspace)
end
end)