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: Bricks

Previous Thread :: Next Thread 
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
08 Jan 2014 04:06 AM
What is the script to unanchored everything?
Report Abuse
Cubyfan22 is not online. Cubyfan22
Joined: 02 Apr 2013
Total Posts: 7261
08 Jan 2014 04:19 AM
That is none of your concern.

Refugio para el alma perdida - Cubyfan2/CommanderUnity | Add 16,381 Posts
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
08 Jan 2014 04:57 AM
Thanks for answering. Now, can a non-childish person answer me?
Report Abuse
Cubyfan22 is not online. Cubyfan22
Joined: 02 Apr 2013
Total Posts: 7261
08 Jan 2014 06:08 AM
No, I mean that is really none of your concern because that script is linked to exploiting right now.

Refugio para el alma perdida - Cubyfan2/CommanderUnity | Add 16,381 Posts
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
08 Jan 2014 06:12 AM
Look into the term "recursion", you need to write a recursive function that calls itself with the children of that instance.
It would work like this:
You pass in "game" as a parameter to the function.
The function says "if THING (passed variable) is a BasePart, then un-anchor it"
Get the children from THING.
For each of the children, call the function with them as the parameter.

I won't write it for you, but give it a go and let us know what you come up with, we'll help you improve it.
What do you want it for, though?
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
08 Jan 2014 02:51 PM
A game I'm making, it's called "Project". I didn't understand anything you just wrote, can you please write it?
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
08 Jan 2014 02:57 PM
@igeorge, we are here to help you with writing scripts and not to write them for you. If you are unwilling to invest time in learning basic principles of scripting, then you cannot expect us to devote a further second to attending to your pleas.
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
09 Jan 2014 03:50 AM
Your reply makes no sense whatsoever.

"Look into the term "recursion", you need to write a recursive function that calls itself with the children of that instance.
It would work like this:
You pass in "game" as a parameter to the function.
The function says "if THING (passed variable) is a BasePart, then un-anchor it"
Get the children from THING.
For each of the children, call the function with them as the parameter. "


What?
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
09 Jan 2014 03:51 AM
Can I get someone else to help me instead of people who aren't willing to help me just because exploiting is going around?
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
09 Jan 2014 05:01 AM
They just did help you.......

Scripting Helpers refers to editing scripts you make!

fill in de blanks!

for _,V in _____(workspace:Get________()) do
if _:IsA("________") ____

v._______ = false

___

end

replace _ with what u think is correct!
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
09 Jan 2014 05:02 AM
And google "Recursion"

and start your "did you mean:" adventure!
:D
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
09 Jan 2014 05:05 AM
Let me try again.

Look into the term "recursion", a recursive function is one that triggers itself.
For example:
function ARecursiveFunction(a)
print(a)
ARecursiveFunction(a+1)
end
... this would infinitely increase "a" and print it.

You need to write a recursive function that calls itself with the children of that instance. An instance is an object in Roblox, like a Humanoid, a Part, a Model, a VehicleSeat, a Tool, anything in Roblox. Children are the descendants of that object, objects that are stored under that Instance in the file tree.

So you need a function that sends the children of the instance that was passed to it to ITSELF:

function unanchor(thing)
children = thing:GetChildren()
for i, #children do
unanchor(children[i])
end
end

Then all you need to do is add in a bit that checks what type of object the instance is, and anchor it if it is a "BasePart".
It would work like this:
You pass in "game" as a parameter to the function.
The function says "if THING (passed variable) is a BasePart, then un-anchor it"
Get the children from THING.
For each of the children, call the function with them as the parameter.
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
09 Jan 2014 03:26 PM
You know what? nevermind. I've had helpers give me the script.
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
09 Jan 2014 07:11 PM
You're not gonna get far at all if you're not gonna learn.
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
10 Jan 2014 10:09 AM
I am really beginning to hate how people like @igeorge behave. It's people like him that are totally spoiling the scripting community.

Invest some time and at least try and learn the language, igeorge. Begging is humiliating.
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
10 Jan 2014 06:51 PM
And you are useless.
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
10 Jan 2014 07:00 PM
Please leave SH, and don't come back until you have YOUR OWN scripts, to edit/fix.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Jan 2014 07:00 PM
^
Report Abuse
duckwit is not online. duckwit
Joined: 08 Aug 2008
Total Posts: 1310
10 Jan 2014 07:20 PM
I. Am. Useless.
I am so useless, that I can even learn things for myself without begging other people for them. What a shame! I am so embarrassed.

I am English, by the way, I have a right to be extremely sarcastic every once-in-a-while.
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
10 Jan 2014 09:06 PM
Get off my post.
Report Abuse
igeorge7159gotban is not online. igeorge7159gotban
Joined: 21 Jun 2011
Total Posts: 185
10 Jan 2014 09:11 PM
local c = game.Workspace:GetChildren()
for i=1, #c do
if c[i].className == "Part" then
c[i].Anchored = false
c[i].CanCollide = false
end
end
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
10 Jan 2014 09:40 PM
factorial Recursion

function factor(x)
if x<=1 then return 1 end
else
return x*factor(x-1)
end

print(factor(5))

---

>> 120
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Jan 2014 09:43 PM
^ Such inefficiency
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
10 Jan 2014 09:50 PM
Just an example of recursion, and it's how you find factorials.

very basic..
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Jan 2014 09:54 PM
No

function factor(z)
if z > 1 then
local total = 1
for i = z, 1, -1 do
total = total * i
end
return total
end
return z
end

print(factor(5))

Is a lot more efficient and easier to understand
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