|
| 23 Apr 2013 10:21 AM |
function gateDestroyed() while script.Parent.Humanoid.Health == 0 do script.Parent.Left Arm.Anchored == nil script.Parent.Head.Anchored == nil script.Parent.Torso.Anchored == nil script.Parent.Right Leg.Anchored == nil script.Parent.Right Arm.Anchored == nil script.Parent.Left Leg.Anchored == nil end end
function(gateDestroyed) |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 23 Apr 2013 10:29 AM |
function gateDestroyed() while script.Parent.Humanoid.Health == 0 do wait() script.Parent["Left Arm"].Anchored = false script.Parent.Head.Anchored = false script.Parent.Torso.Anchored = false script.Parent["Right Leg"].Anchored = false script.Parent["Right Arm"].Anchored = false script.Parent["Left Leg"].Anchored = false end end
gateDestroyed()
|
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 10:32 AM |
@Desperian Still wont work, even though no error is in the output anymore. Also, why did you put a wait() there? |
|
|
| Report Abuse |
|
|
eletrowiz
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 12438 |
|
|
| 23 Apr 2013 10:40 AM |
The wait() is to prevent an infinite loop, and the game crashing.
-={3137}=- |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 10:54 AM |
| k, that makes sense, but why doesnt it unanchor when its health is gone? |
|
|
| Report Abuse |
|
|
eletrowiz
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 12438 |
|
|
| 23 Apr 2013 11:02 AM |
I don't quite know.
Try to do this.
function gateDestroyed() while script.Parent.Humanoid.Health <= 0 do wait() script.Parent["Left Arm"].Anchored = false script.Parent.Head.Anchored = false script.Parent.Torso.Anchored = false script.Parent["Right Leg"].Anchored = false script.Parent["Right Arm"].Anchored = false script.Parent["Left Leg"].Anchored = false end end
gateDestroyed()
-={3137}=- |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 11:06 AM |
| None of these scripts are working. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 11:08 AM |
| are u sure u have connected the function or called it? |
|
|
| Report Abuse |
|
|
eletrowiz
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 12438 |
|
|
| 23 Apr 2013 11:08 AM |
What exactly are you attempting to do?
-={3137}=- |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 23 Apr 2013 11:08 AM |
| Then the likely hood is that the parts you're unanchoring are welded to something or another. When trying the script, check in the explorer and see if the 'Anchored' property is ticked for the item that's meant to be unanchored. |
|
|
| Report Abuse |
|
|
eletrowiz
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 12438 |
|
|
| 23 Apr 2013 11:10 AM |
@Des If the humanoid already has 0 health it should break joints. Not quite sure what OP is trying to do though...
-={3137}=- |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 11:10 AM |
@desperian I did. It remains anchored. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 11:11 AM |
@electro make it break the joints. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 23 Apr 2013 11:12 AM |
@Ele,
Mmm, it'd be nice if he gave us some context. |
|
|
| Report Abuse |
|
|
eletrowiz
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 12438 |
|
|
| 23 Apr 2013 11:16 AM |
If you are trying to break the joints...
function gateDestroyed() while script.Parent.Humanoid.Health <= 0 do wait() script.Parent:BreakJoints() end end
gateDestroyed()
-={3137}=- |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 11:18 AM |
@electro It still isnt working. |
|
|
| Report Abuse |
|
|
| |
|
ohno1112
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 833 |
|
|
| 23 Apr 2013 11:40 AM |
i saw the fault, this shoudl be working:
don't quite know.
Try to do this.
function gateDestroyed() while script.Parent.Humanoid.Health == 0 do script.Parent["Left Arm"].Anchored = false script.Parent.Head.Anchored = false script.Parent.Torso.Anchored = false script.Parent["Right Leg"].Anchored = false script.Parent["Right Arm"].Anchored = false script.Parent["Left Leg"].Anchored = false wait(3) end end
----------------------however you only yet need to make a connector for the function, i have no idea what to do for when a part is destroyed. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 23 Apr 2013 12:04 PM |
Something like this may be more appropriate for the situation, however i'm not 100% sure what your trying to do.
script.Parent.Humanoid.Died:connect(function() -- runs when humanoid dies. for i,v in pairs(script.Parent:GetChildren()) do --get everything inside script.Parent if v:IsA("Part") then -- check if its a part v.Anchored = false -- unanchor if it is a part end end end
|
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 12:08 PM |
@Mrgames That didn't work either...
Heres the deal: I want the model (gate) to break apart like a player does when the health is gone. Simple as that. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2013 12:11 PM |
This might fix it, since the head and torso have a weld connecting them.
script.Parent.Humanoid.Died:connect(function() script.Parent:BreakJoints() for i,v in pairs(script.Parent:GetChildren()) do if v:IsA("Part") then v.Anchored = false end end end
|
|
|
| Report Abuse |
|
|
| |
|