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?
A function is something you call when you need the it to run.
Ex.
function Run(Player) print(Player.Name .. " has entered the server"); end game.Players.PlayerAdded:connect(function(Player) Run(Player) end)