33 posts
Posted 19 October 2016 - 06:28 PM
hi guys
yep im back for help
for WOS 2.0 i need functions but cant figure out how to use them
the link for this is
http://pastebin.com/7ZDgrfvythanks
-JoshGreatUK
2427 posts
Location
UK
Posted 19 October 2016 - 07:03 PM
you need to define functions before you use them:
local function foo() --# define the function
--# code here will execute when function is called
--# multiple lines are accepted
end
local bar = function() --# alternative way of defining functions
--# content as above
end
foo() --# call the function
bar() --# calling is the same nomater how it was defined
Edited on 19 October 2016 - 05:05 PM
3057 posts
Location
United States of America
Posted 19 October 2016 - 07:39 PM
It looks like you have function calls to non-existent functions. Define those functions at the top of your script.
Ex:
local function helloWorld()
print( "Hello, World!" )
end
--#later on in the program, calling it
helloWorld()