generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

I am new to scripting... help...

Previous Thread :: Next Thread 
Harple is not online. 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 is not online. 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 is not online. 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
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
05 Jul 2015 01:05 PM
what are you trying to do>>
Report Abuse
Harple is not online. 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
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image