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: Not much of a scripter...

Previous Thread :: Next Thread 
armitroner is not online. armitroner
Joined: 05 Jul 2008
Total Posts: 5759
03 Apr 2013 09:14 PM
How would I go about having all parts of a model becoming unanchored, then re-anchored again, and then reset to original position?
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
03 Apr 2013 09:15 PM
for i,v in pairs(script.Parent:GetChildren()) do
v.Anchored = false
v.Anchored = true
end

That's assuming you don't have parts inside of parts.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
03 Apr 2013 09:17 PM
Actually, ignore me.
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
03 Apr 2013 09:17 PM
You mean like unanchored for a time period and reset?
Report Abuse
armitroner is not online. armitroner
Joined: 05 Jul 2008
Total Posts: 5759
03 Apr 2013 09:18 PM
Yeah... I want to make something fall and then go back up again.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
03 Apr 2013 09:25 PM
ModelClone = script.Parent:Clone()

TimeBeforePartsFall = 10 --Change to how long you want till the parts fall

TimeBeforeModelIsMovedBack = 10 --Change to how long you want till the model moves back

for NumberOfParts = 1,#script.Parent:GetChildren()

wait(TimeBeforePartsFall)

if script.Parent:GetChildren()[NumberOfParts].ClassName == "Part" then

script.Parent:GetChildren()[NumberOfParts].Anchored = false

end

wait(TimeBeforeModelIsMovedBack)

ModelClone.Parent = Workspace

script.Parent:Destroy()

end




Script goes in the model.
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
03 Apr 2013 09:26 PM
I assume you want it to kinda explode or fall apart without an explosion, right? And have a "round time" where the building is unanchored and have a "wait time" where the building is anchored.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
03 Apr 2013 09:51 PM
I'm sorry I messed up on my script.


ModelClone = script.Parent:Clone()

TimeBeforePartsFall = 10 --Change to how long you want till the parts fall

TimeBeforeModelIsMovedBack = 10 --Change to how long you want till the model moves back

for NumberOfParts = 1,#script.Parent:GetChildren() do

wait(TimeBeforePartsFall)

if script.Parent:GetChildren()[NumberOfParts].ClassName == "Part" then

script.Parent:GetChildren()[NumberOfParts].Anchored = false

end

end

wait(TimeBeforeModelIsMovedBack)

ModelClone.Parent = Workspace

script.Parent:Destroy()
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
03 Apr 2013 09:52 PM
local waitTime = 10 --Seconds
local roundTime = 60 --Seconds
local model = game.Workspace["Model Name Here!"]

for i,v in pairs(model:GetChildren()) do --Don't worry about this part. It only makes sure everything is anchored
if v:IsA("Part") then
v.Anchored = true
end
end

while wait(waitTime) do--This will repeat infinitly.
local newModel = model:Clone()
for i,v in pairs(model:GetChildren()) do
if v:IsA("Part") then
v.Anchored = false
end
end
model:BreakJoints()
wait(roundTime)
model:Destroy()
model = newModel
model.Parent = Workspace
end
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
03 Apr 2013 09:53 PM
Why did you add breakjoints? He didn't ask for that.

My script goes infinitly to. Without a while loop.
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
03 Apr 2013 09:56 PM
I fixed the breakjoints in a PM to him.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
03 Apr 2013 10:00 PM
If he had asked for it I would have added it.

He PM'd me and asked me to fix it as well.
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