How Do You Do That???
Simply wrap the entirety of your code into a function that gets called when the remote is fired.
function main() --do stuff end remoteEvent.OnClientEvent:Connect(main)