|
| 05 Feb 2012 01:41 PM |
it will not work is it the script's fault or can it not break joints if its not set to true for can collide?
function onTouched(hit)
hit:BreakJoints()
end
connection = script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 05 Feb 2012 01:49 PM |
function onTouched(hit)
hit:BreakJoints() end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 05 Feb 2012 01:51 PM |
you already made a thread like this a minute ago >.>
i don't believe cancollide false bricks can activate a ontouched script. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 01:54 PM |
| I kinda need it to be set to false though |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 05 Feb 2012 01:58 PM |
Touched still fires on CanCollide false blocks, try this -
function onTouched(hit)
if hit ~= nil then hit:BreakJoints() end end
connection = script.Parent.Touched:connect(onTouched)
Make sure the script is in the block you want to be hit as well! |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 05 Feb 2012 02:00 PM |
| whenever i try'd to do a touched script with a cancollide false it never worked :/ |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 05 Feb 2012 02:01 PM |
| Then you must have been doing it wrong. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:06 PM |
| magnalite can you make it so that I only have to put it in the block that I want to break stuff |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 05 Feb 2012 02:07 PM |
| Sorry that's what i meant. It already does that. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:09 PM |
| the script you gave me wont work |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:12 PM |
script.Parent.Touched:connect(function(hit) if hit ~= nil then hit:BreakJoints() end end)
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:13 PM |
Wait, did you want somebody to be killed?
† KMXD † |
|
|
| Report Abuse |
|
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 05 Feb 2012 02:16 PM |
| The thing running into does consist of more than one block right?? |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:17 PM |
nope that didn't either okay ill explain what I need it for:
I'm making a disaster type game where you have to survive raising water and it breaks everything it hits however The only way I can get it to rise is to set it to non can collide |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:20 PM |
| mangalite I need it to break ever part it hits |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 05 Feb 2012 02:25 PM |
You want a single part to break? If the part is a single part, then it wouldn't break because it isn't jointed with anything. --[[oi.]]--
script.Parent.Touched:connect(function(hit) if hit.Parent then hit.Parent:BreakJoints() end end) |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:27 PM |
| @Phellem I want it to break every part it hits |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 05 Feb 2012 02:28 PM |
Since I have no idea what you're trying to do, I list the code on what I think you meant:
--Break the parent joints script.Parent.Touched:connect(function(hit) if hit.Parent then hit.Parent:BreakJoints() end end)
--Turn the brick to CanCollide = false script.Parent.Touched:connect(function(hit) if hit:IsA("Part") then hit.CanCollide = false end end)
--Delete the hit script.Parent.Touched:connect(function(hit) if hit:IsA("Part") then hit:Destroy() end end)
--Explode the part script.Parent.Touched:connect(function(hit) if hit:IsA("Part") then Instance.new("Explosion",workspace).Position = hit.Position end end) |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:30 PM |
| *FACEDESK* I just explained what I want it to do!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I WANT THE PART THE SCRIPT IS IN TO BREAK THE JOINTS OF ANY PART IT HITS |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 05 Feb 2012 02:32 PM |
--Be patient... It was a latepost.
script.Parent.Touched:connect(function(hit) if hit:IsA("Part") then hit:BreakJoints() end end) |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:32 PM |
Do you know what breaking the joints do?
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:36 PM |
| Yes I do breaking the joints causes the part to become disconnected from what it was connected to |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 05 Feb 2012 02:39 PM |
When the water rise, did it killed you? If so, the joint is broken.
script.Parent.Touched:connect(function(hit) if hit:IsA("Part") then hit:BreakJoints() end end) |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2012 02:41 PM |
| no it did not kill me or break anything |
|
|
| Report Abuse |
|
|