A better way would be to just add another event clientside that the server triggers when 'SampleFunction' is done.
Client:
triggerServerEvent("SampleEvent", getLocalPlayer())
function callComplete ()
--continue
end
addEvent( "SampleFunctionDone", true )
addEventHandler( "SampleFunctionDone", getRootElement(), callComplete)
Server:
function SampleFunction( )
outputChatBox( "Doing Sample Function", source )
-- do something useful
triggerClientEvent( source, "SampleFunctionDone", source)
end
addEvent( "SampleEvent", true )
addEventHandler( "SampleEvent", getRootElement( ), SampleFunction )