zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 08:00 PM |
part = script.Parent.Parent.BrickA
local brick = script.Parent.Parent.BrickA function onTouch(part) part.CFrame = part.CFrame * CFrame.new(1,1,1) end
part.Touched:connect(onTouch)
I made this in my spare time and I was super tired and bored, I have no idea where I messed up (because it's my first time trying this kind of thing, just using old tactics from other scripts I have made) so can someone please inform me where to fix it? |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 08:02 PM |
| Also I know the "part = script.Parent.Parent.BrickA" is correct because I tested it, it's the onTouch part that's messing it up.. |
|
|
| Report Abuse |
|
|
| |
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 06 Nov 2012 08:14 PM |
Anchor the brick if you dont want it to fall first now if you just want to put the script in brick it's easier, if not if the block has to be in the workspace, and the local brick = is not needed.
rewrite
part = script.Parent.Parent.BrickA function onTouch(part) part.CFrame = part.CFrame * CFrame.new(1,1,1) end
part.Touched:connect(onTouch)
didnt test it... remember to anchor it. |
|
|
| Report Abuse |
|
|
hayes947
|
  |
| Joined: 15 Nov 2010 |
| Total Posts: 172 |
|
|
| 06 Nov 2012 08:42 PM |
| Other people see a script, I see a bunch of lines with no obvious purpose. DX What was the script intended to do anyways? |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 09:19 PM |
| It's supposed to be something that starts an animation, once you touched the invisible wall then the bricks ahead of you start to lay down, as if your constructing the city. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 09:19 PM |
| I'm pretty good at making animations (I am pretty new to scripting but animating doesn't really take any skill, just a lot of time and testing...) |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 10:31 PM |
| By the way none of the examples above worked, but thanks for trying.. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 06 Nov 2012 10:41 PM |
local part = script.Parent
function onTouch() part.CFrame = part.CFrame* CFrame.new(1,1,1) end
part.Touched:connect(onTouch)
--sublime ya |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 06 Nov 2012 10:42 PM |
whoops.
fix part, I was using it for testing. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 11:09 PM |
| That would be local though, it's in a model.. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 11:12 PM |
I made some edits but it still doesn't work..
part = script.Parent.Parent.BrickA
function onTouch(part) script.Parent.Parent.BrickA.CFrame = script.Parent.Parent.BrickA.CFrame * CFrame.new(1,1,1) end part.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 06 Nov 2012 11:15 PM |
local part = script.Parent.Parent.BrickA --it works...
function onTouch() part.CFrame = part.CFrame* CFrame.new(1,1,1) end
part.Touched:connect(onTouch)
--sublime ya |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 11:18 PM |
| I wanted it when you touched the parent of the script it CFrames that. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 06 Nov 2012 11:21 PM |
| Your second one worked but not the first one, and the second one is when you touch that brick. |
|
|
| Report Abuse |
|
|
pashmi
|
  |
| Joined: 27 Jan 2010 |
| Total Posts: 7120 |
|
|
| 07 Nov 2012 10:48 AM |
Try this:
function onTouch(part2) Workspace.part2.Cframe = Vector3.new [put the position here]
Workspace.part1:Touched:connect(onTouch)
-----------------
That should work :D |
|
|
| Report Abuse |
|
|