can only give you a partial answer..
create a gamelogic somewhere on your map, name it "server"
in the script that should only run on server, insert the following line on top:
?!local Server: exit
this exits the script if the machine it is runnin is not the server