Zikefire
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 328 |
|
|
| 28 Oct 2011 08:08 PM |
I am trying to make a simple script that will make the block "sand" move down through the floor when touched then come back up. One problem. It doesn't work!
script.Parent.Touched:connect(function(part)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) end)
This is was it says in the output: Disconnected event because of exception |
|
|
| Report Abuse |
|
|
|
| 28 Oct 2011 08:39 PM |
script.Parent.Touched:connect(function(part) sand = part sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0)) wait(1) end)
You never declared what sand was. Anyways, Y U NO USE FOR LOOP? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 28 Oct 2011 10:03 PM |
=-=
For loop makes this easier.. |
|
|
| Report Abuse |
|
|