What I mean by "variable function" is to have a premade function run. Ex:
function speed(p)
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
end
script.Parent.MouseButton1Click:Connect(function()
--- Here would run "speed"
end
Sorta like how RemoteEvents Work

3 comments
???
when you click the button it will make ur walkspeed = 0, from the function "speed"
Incorrect use of terminology can be very confusing for others. It's just called a 'function'. If I were to re-word your question, it would become "How do I call a function?". Your question could have been answered easily if you were willing to do a bit of research. Have a look at this wiki post for more on functions: http://wiki.roblox.com/index.php?title=Scripting_Book/Chapter_2