I’ve been trying to come up with a system for a RemoteEvent that can handle multiple connections. If that sounds confusing, what I’m essentially trying to do is this:
local remoteEvent = --The remote event
local player = --The player allowed to activate the event in this instance
--This value is also constantly changing
local function onServerEvent(plr)
if player == plr then
-- Do something
end
end
remoteEvent.OnServerEvent:Connect(onServerEvent)
I have this script copied throughout my game, except with different players who can activate the RemoteEvent, with those players always changing. I don’t think this script is as efficient as it could be because of all the connections to a single RemoteEvent.
I’ve thought about having a main Script in ServerScriptService to control Bindable Events for each instance of this script, but I just don’t know how to execute anything correctly. Any pointers would help.
*Gonna go to sleep in a bit and might not see replies until tomorrow.