Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
| |
|
|
| 12 Oct 2013 03:59 PM |
| In studio, open up explorer and properties. Then open up the model. Hold down shift or ctrl and select all the parts in the model. Look in the properties and uncheck anchored. |
|
|
| Report Abuse |
|
|
Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 12 Oct 2013 04:01 PM |
| oops, should have clarified better. I want to make a script where after touching a brick, all parts in a model are unanchored without changing them one by one. |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 04:26 PM |
| game.workspace.model.Anchored= False |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 04:29 PM |
Nicklas.. e.e
model = game.Workspace.MODELNAMEHERE
function unanchor() for i, v in pairs do v.Anchored = false end
--some connectnig function here to connect unanchor() and being touched :D |
|
|
| Report Abuse |
|
|
Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 12 Oct 2013 05:04 PM |
deadzonepred,
I'm not sure exactly how to tie that in so that it happens on touch... this is what I have (I know it's wrong)
_______________ function onTouched(part)
model = game.Workspace.walkway
function unanchor() for i, v in pairs do v.Anchored = false end
end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
|
| 12 Oct 2013 05:18 PM |
m = game.Workspace.Model:GetChildren() for i = 1, #m do if m.ClassName == "Part" then m.Anchored = false end end
|
|
|
| Report Abuse |
|
|
Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 12 Oct 2013 05:29 PM |
@above
Ok, this is what I have: ----------- function onTouched(part)
m = game.Workspace.walkway:GetChildren() for i = 1, #m do if m.ClassName == "Part" then m.Anchored = false end end
end script.Parent.Touched:connect(onTouched) -----------
but for some reason, the model is being unanchored without me even touching the brick? |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 12 Oct 2013 05:33 PM |
debounce = false script.Parent.Touched:connect(function(part) if game.Players:GetPlayerFromCharacter(part.Parent) and not debounce then debounce = true for _,v in pairs(game.Workspace.walkway:GetChildren()) do if v:IsA'BasePart' then m.Anchored = false end end end end)
-- Try that now.
|
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 12 Oct 2013 05:34 PM |
: ----------- function onTouched(part) if part.Parent:findFirstChild("Humanoid") then m = game.Workspace.walkway:GetChildren() for i = 1, #m do if m.ClassName == "Part" then m.Anchored = false end end end end script.Parent.Touched:connect(onTouched) -----------
|
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 12 Oct 2013 05:36 PM |
Bee, a lot of that is very unnecessary.
By the way, only copy and paste what is between the ------ with mine, ignore the :, it's a typo. |
|
|
| Report Abuse |
|
|
Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 12 Oct 2013 05:40 PM |
| Ok, I am so confused. Everyone's scripts work, but they all unanchor the bricks before I even touch the brick that is supposed to trigger it. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 12 Oct 2013 05:46 PM |
@Mario5422, A. Either you forgot to unanchor the parts
or
B. Use the latter scripts shown.
btw
"m.ClassName == "Part" then"
You mean m[i][.ClassName == "Part"... right?
|
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 12 Oct 2013 05:49 PM |
| You're right, but it ain't my fault (in a way); I just copied Ggggg's script and added the if statement to avoid it being called by a non player. |
|
|
| Report Abuse |
|
|
Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 12 Oct 2013 06:00 PM |
ok, I'm embarrassed, the parts in the model were already unanchored.
but after anchoring them all, none of the scripts are working when I touch the trigger brick. |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 06:01 PM |
@bebee "if v:IsA'BasePart' then m.Anchored = false" Le v Le m |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 12 Oct 2013 06:02 PM |
debounce = false script.Parent.Touched:connect(function(part) if game.Players:GetPlayerFromCharacter(part.Parent) and not debounce then debounce = true for _,v in pairs(game.Workspace.walkway:GetChildren()) do if v:IsA'BasePart' then v.Anchored = false end end end end)
-- I always make those small mistakes.
|
|
|
| Report Abuse |
|
|
Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 12 Oct 2013 06:04 PM |
@bebee
Yay, that works!! :D Thanks! |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 06:35 PM |
for i,v in pairs(model:children()) do ypcall(function() v.Anchored=true end) end |
|
|
| Report Abuse |
|
|
stephen77
|
  |
| Joined: 18 Dec 2008 |
| Total Posts: 49 |
|
|
| 12 Oct 2013 06:45 PM |
@stephen1182, Hes asking for an unanchor... for i,v in pairs(model:children()) do pcall(function() v.Anchored=false; end); end |
|
|
| Report Abuse |
|
|
| |
|