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 » Scripting Helpers
Home Search
 

Re: Function

Previous Thread :: Next Thread 
jinglebombs is not online. jinglebombs
Joined: 14 Sep 2008
Total Posts: 190
06 Feb 2014 07:37 PM
how do I call a function, I want a loop to play and have the function outside of it, but it wont work no matter how I try it
Report Abuse
jinglebombs is not online. jinglebombs
Joined: 14 Sep 2008
Total Posts: 190
06 Feb 2014 07:46 PM
please, I wrote dropLava() and the function Im trying to call is "function dropLava()"
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 07:47 PM
dropLava()
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
06 Feb 2014 07:47 PM
Creating a function -
function FuncName()
while true do
end

Calling a function -


FuncName()

~The G
Report Abuse
jinglebombs is not online. jinglebombs
Joined: 14 Sep 2008
Total Posts: 190
06 Feb 2014 07:50 PM
I did exactly that...
lava = script.Parent.Lava:getChildren()
while true do
dropLava()
wait(.2)
end

function dropLava()
i = math.random(1, #lava)
c = Lava[i]:clone()
c.Parent = script.Parent.Clones
c.Position = lava[i] - Vector3.new(0,1.2,0)
wait(3)
c:destroy()
end

Error "attempt to call global 'dropLava'(a nil value)"
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 07:52 PM
-.- it's because it's not created when you called it, and it never will since an infinite loop will run.
Report Abuse
jinglebombs is not online. jinglebombs
Joined: 14 Sep 2008
Total Posts: 190
06 Feb 2014 07:52 PM
thanks, I didnt know :P
Report Abuse
jinglebombs is not online. jinglebombs
Joined: 14 Sep 2008
Total Posts: 190
06 Feb 2014 07:55 PM
is there any way to make it drop one every .2 seconds rather than every 1.2? it adds those in the loop and the function
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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