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: How do I make a function loop?

Previous Thread :: Next Thread 
Billship is not online. Billship
Joined: 14 Sep 2013
Total Posts: 25
21 Oct 2013 03:58 PM
What would I have to do with a function to make it continuously repeat? While true do doesn't seem to work, or I'm just putting it in the wrong spot.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
21 Oct 2013 03:59 PM
function Name()
-- What happens
end

while true do wait()
Name()
end


Isn't this supposed to work?
Report Abuse
Kisa97 is not online. Kisa97
Joined: 14 Aug 2008
Total Posts: 1143
21 Oct 2013 04:00 PM
I am not sure, Can you trigger a function from inside itself? If you can, then

function test()
--script here

test()

--start up connection?

No clue :D Experiment!
Report Abuse
Billship is not online. Billship
Joined: 14 Sep 2013
Total Posts: 25
21 Oct 2013 04:12 PM
Here, let me show you what I mean:


count = script.Parent.Parent.Name
function onClicked(playerWhoClicked)
script.Parent.Parent.Name = count+1 --This is the thing I want to repeat, so that everytime the function onClicked happens, the count (name of the model) goes up by 1. It only goes up once, then it stops.
wait(0.5)
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
21 Oct 2013 04:15 PM
Uhh, do you have any output?

What are you exactly trying to do with the model, I do not understand, are you trying to make it count + 1 every time you click the button or what?
Report Abuse
Billship is not online. Billship
Joined: 14 Sep 2013
Total Posts: 25
21 Oct 2013 04:16 PM
Yes that's what I want.
Report Abuse
Billship is not online. Billship
Joined: 14 Sep 2013
Total Posts: 25
21 Oct 2013 04:18 PM
Okay I figured it out on my own thanks for the help though
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
21 Oct 2013 04:20 PM
count = script.Parent.Parent
val = script.Parent.Parent["Value Name"] --Make it NumValue
function onClicked(playerWhoClicked)
count.Name = "Count: " ..val
wait(0.5)
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
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