Global variable not carrying over to "run script"

I am trying to use smaller scripts to call the larger script with all the code but using global variables defined in the caller script.

Here is pretty much what I have done:

global userName
set userName to “Name”
set scriptPath to “Path:to:script.scpt”
run script scriptPath

When I run this I get a “userName not defined” error. I know I am missing something OBVIOUS. Any help would be greatly apprecaited, thanks!


set x to load script file scriptPath
run x

Works perfect, thank you!