I'm kinda new to scripting and all, but how do I call functions?
Oh, it's quite easy once you get the hang of it.
function addNumbers() --Your function print(5+5) end addNumbers() --To call the function, simply put its name, followed by two parentheses.
For events though, here's how it would work:
function touch() print('Something was touched by something else!') end script.Parent.Touched:connect(touch)--Check events on the wiki for this. Script.Parent is referencing the brick that the script is child unto.
You simply type the function's name and then add parenthesis.
function Function() print("How to call a functon") end Function() --Called the function --Notice you can't name a function "function" because it's a keyword, "Function" with a capital F is ok
Some functions can be called using an event, for example the Toched event
function Function() printf("How to call a function using an event - example") end --Now you need to add the calling line which will refer to the object you want to be touched so the function will start running --Say the script is inside the object (that you want to touch to make the function start running) script.Parent.Touched:connect(Function)