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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How do I make my own print function

Previous Thread :: Next Thread 
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
07 Jan 2012 10:04 AM
It needs to accept a virtually unlimited number of parameters, and then I need to loop over them and do something with them.
Report Abuse
1Ra is not online. 1Ra
Joined: 02 May 2010
Total Posts: 2400
07 Jan 2012 10:07 AM
explain better.
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
07 Jan 2012 10:09 AM
function print1337(...)

for i,v in pairs(...) do
--- do stuff
end

end

print1337(pcall(randomfunction, randomparameter))
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
07 Jan 2012 10:12 AM
Never mind I figured it out, you use "arg"
Report Abuse
Merlin11188 is not online. Merlin11188
Joined: 20 Dec 2007
Total Posts: 4158
07 Jan 2012 10:15 AM
Print works that way already. I thought you meant a custom function to print something to the output without using the 'print' function. That would be difficult, if not impossible, with RBX.lua.
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
07 Jan 2012 10:21 AM
I want to make a function that accepts any amount of arguments, and does something for each argument.

function f(...)
for i,v in ipairs(...) do
-- do something
end
end

f(string.gsub("lojksdflja", "a", "e"))

But I can't figure out how to do this. Help?
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