Harple
|
  |
| Joined: 08 Oct 2012 |
| Total Posts: 2006 |
|
|
| 05 Jul 2015 12:45 PM |
myVariable = 5
function hello() print("down") print("left") print("right") return end
print(myVariable)
myVariable = hello()
print(myVariable)
Y THIS NOT WORK!!!! D; |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 05 Jul 2015 12:47 PM |
You're not returning anything from the hello() function. In the second last line you set "myVariable" to whatever the function hello() returns, which is nothing/
while true do the do |
|
|
| Report Abuse |
|
|
Harple
|
  |
| Joined: 08 Oct 2012 |
| Total Posts: 2006 |
|
|
| 05 Jul 2015 12:48 PM |
| So, do I put a value next to the "return"? |
|
|
| Report Abuse |
|
|
|
| 05 Jul 2015 01:05 PM |
| what are you trying to do>> |
|
|
| Report Abuse |
|
|
Harple
|
  |
| Joined: 08 Oct 2012 |
| Total Posts: 2006 |
|
|
| 05 Jul 2015 01:18 PM |
| Just practicing returns, im new to scripting so, I gotta practice the basics :P |
|
|
| Report Abuse |
|
|
|
| 05 Jul 2015 01:23 PM |
exampleeee
variable = 5
function hello() local thing = "down" return thing end
variable = hello()
print(variable)
return is basically printing a result if that makes sense
except it's not just printing so like
function equation() local add = math.random(1,10) return add end
print(1+equation()) |
|
|
| Report Abuse |
|
|