It seems like TTS doesn't assign new GUIDs (on id collisions) to objects that are copied before scripts are run on them and not until some time after onLoad() was called.

Suggestion

Changing this behavior to ensure that GUIDs are indeed as they say globally unique before scripts run would be appropriate.

Currently if you want to be sure you know your own GUID in your script body or in onLoad() you have to resort to a delayed coroutine to find out.

Code:
function onLoad()
    startLuaCoroutine(self, 'delayedFunction')
end

function delayedFunction()
    coroutine.yield(0)  -- yield to TTS, so that it fixes guids first
    print(self.guid) -- this guid has a higher chance of being unique
    return 1
end
Which is a silly workaround.

Of course, changing this behavior is a breaking change. Someone might be using this momentary GUID duplication, for example you could track the original object that a new object was copied from:

Code:
function onLoad()
    local me = getObjectFromGUID(self.guid)
    if me ~= self then print('I am not myself') end
end
So if behavior changes, this scenario should probably be covered by some other mechanism, possibly a new event like onCopied() or perhaps even better onObjectCreated() since we have events for when objects are destroyed but not created. But this is better discussed in a different thread.