What is a function used for?
✓ ANSWER ACCEPTED
How do you use a function?
1 answer
✓ Accepted answer
A function is a set of things that happens when it is called.
--Here is one way to do it
local function Func ()
print("Hello!")
end
--Some other code can go here
Func()
-- Heres a way for it to wait for something to happen! you dont need to set it up like this but i prefer this way
workspace.BasePlate.Changed:connect(function()
print("Something happened to the plate!")
end)
--Heres the other way
local function Listen()
print("Something happened to the plate!")
end
workspace.BasePlate.Changed:connect(Listen)
3 comments
0
More info here: http://wiki.roblox.com/index.php?title=Function
0
This is a great answer, but also consider watching this video for further explanation. https://www.youtube.com/watch?v=xzEBppiO9xs
0
What he said ^
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
http://wiki.roblox.com/?title=Scripting