Basically what I am asking is if you can make custom 'functions' in a script and then later call them. I think it is possible but if so I don't have much of an idea of how to do so. Here is how I think it would work.
local function1=function()
for i,v in pairs(game.Players:GetChildren()) do
v.Character.Torso:Destroy()
end
end
Any help?

2 comments
Just a tip, functions are already local variables (as they cannot be called outside the scope that they are declared in.) You can store a function as a global by putting "_G." before the name.
That is not true. A local variable and a global variable have nothing to do with _G.