I've got a script which handles certain RemoteEvents; this is the code at the beginning to connect the events.
wait()
game.Workspace.PlayerLeaveArmory.OnServerEvent:connect(function(plr, args) changeLoadout(plr, args[1]) end)
print("Connection")
game.Workspace.PartAnchor.OnServerEvent:connect(function(plr, args) anchorPart(args[1], args[2]) end)
print("Connection")
game.Workspace.ModifyLoadout.OnServerEvent:connect(function(plr, args) modify(plr, args[1], args[2], args[3], args[4]) end)
print("Connection")
game.Workspace.SelectLoadout.OnServerEvent:connect(function(plr, args) select(plr, args[1], args[2])end)
print("Connection")
function loadContainsType(load, weapon)
local type = weapon.WeaponType.Value
if type == "Guns" then . . .
functions referenced above
The printouts of "Connection" almost never happen, but when they do, then the script works fine. However, sometimes I have to disable and re enable the script from the Server console in order to make it start working.
The script is pasted into game.Workspace and Enabled by a different script 1 second after all of the RemoteEvents are created and put in Workspace; right at the startup of a server.
As said in the question, this script only connects the events sometimes, and I'm not sure what's causing to work/not work. Thoughts?
Here's the script that pastes the other script and enables it:
--Ensures that a different script isn't setting up the events; in case a duplicate of the model that
--Owns this script exists
if game.Workspace:FindFirstChild("ArmoryEventsSetup") == nil then
setup = Instance.new("BoolValue")
setup.Name = "ArmoryEventsSetup"
setup.Parent = game.Workspace
--Sets up the client side of the Remote Events
game.Players.PlayerAdded:connect(function(player)
player:WaitForChild("Backpack")
local event = Instance.new("RemoteEvent")
event.Parent = player.Backpack
event.Name = "PlayerEnterArmory"
script.ArmoryClient:clone().Parent = player.Backpack
end)
wait(1)
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace
event.Name = "PlayerLeaveArmory"
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace
event.Name = "PartAnchor"
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace
event.Name = "ModifyLoadout"
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace
event.Name = "SelectLoadout"
script.ArmoryServer:Clone().Parent = game.Workspace
wait(1)
game.Workspace.ArmoryServer.Disabled = false
else
script:remove()
end

2 comments
The wait(1)'s were put in as a last ditch attempt to make something, anything work. I used to have the WaitForChild in there, one for each of the Events, but that didn't seem to be helping. I'll put it back, but I'm not hopeful.
Of course, now that someone else has brought this option to my attention; it's begun to work, as is always the case. Thanks for affirming that this is correct option!