You can tell whether you are on a dedicated server, so you don't have to do:
/* If (isServer) exitwith {}; Change when uploading to a Dedicated server. */
Instead, try:
// Exit on a dedicated server, but not on an SP or hosted server.
if (isServer and (isNull player)) exitwith {};
In SP or hosted games, the value of
player on the server is set correctly at the very start of the mission, but on an MP server it is always null. Remember that this method is only valid at time == 0, since after that, the server-player could be dead (so
player may, or may not, be null after this time).
On an MP client,
player is initially null, but is set correctly when the player syncs.