Jump to content




How to load functions?


  • You cannot reply to this topic
4 replies to this topic

#1 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 01 May 2013 - 08:47 AM

How to load functions like this code:

function sayHi()
print("Hi")
end

-- function load code??

#2 MR_nesquick

  • Members
  • 106 posts
  • LocationNorway

Posted 01 May 2013 - 08:56 AM

you call the function by it's name. in you're case it's sayHi()

#3 thegreatstudio

  • Banned
  • 164 posts
  • LocationI am on your computer

Posted 01 May 2013 - 08:58 AM

how about many functions??

#4 MR_nesquick

  • Members
  • 106 posts
  • LocationNorway

Posted 01 May 2013 - 09:02 AM

Try to read it up on CC wiki http://computercraft...Function_(type) ;)

#5 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 01 May 2013 - 09:02 AM

View Postthegreatstudio, on 01 May 2013 - 08:58 AM, said:

how about many functions??

local function one()
  print("Function 1")
end

local function two()
  print("Function 2")
end

one()
two()






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users