|
| 13 Oct 2013 01:27 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent and hit.Parent.Name=='wave' then print(hit.Parent.Name) for i, v in pairs(hit.Parent:GetChildren()) do v.CFrame=v.CFrame+Vector3.new(0,-10,0) end end end) |
|
|
| Report Abuse |
|
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 03:57 PM |
script.Parent.Touched:connect(function(Hit) if Hit and Hit.Parent and Hit.Parent.Name == 'wave' then print(Hit.Parent.Name) for i,v in next, Hit.Parent:GetChildren() do if v:IsA('BasePart') then v.CFrame = v.CFrame + Vector3.new(0,-10,0) end end end end) |
|
|
| Report Abuse |
|
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 04:05 PM |
| Then the name of the parent is not 'wave' |
|
|
| Report Abuse |
|
|
| |
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Oct 2013 04:08 PM |
| v.CFrame = v.CFrame * CFrame.new(0, -10, 0) |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 04:12 PM |
| Does it print the parent's name? |
|
|
| Report Abuse |
|
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 04:14 PM |
| "Then the name of the parent is not 'wave'" |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Oct 2013 04:15 PM |
v.CFrame = v.CFrame * CFrame.new(0, -10, 0)
.-. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 04:17 PM |
| @get, that's not going to help. |
|
|
| Report Abuse |
|
|
| |
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
| |
|
|
| 13 Oct 2013 04:19 PM |
| Get if it doesn't print why do you think it will get to the CFrame part of the script? |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Oct 2013 04:20 PM |
also
- put the print outside the if statement - there's no use for the i, so you could just say for _, v in pairs |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Oct 2013 04:21 PM |
| I am very sorry I tried to help you, dear kind sir. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
| |
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Oct 2013 04:22 PM |
Zach, I thought this forum exists to get advanced scripters to help others?
Speaking of 'advanced scripters', I think it's you who should get out. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 04:25 PM |
I am an advanced scripter, I can prove that. I never told you to get out, I just told you to stop because all of your posts whave done nothing to help.
@re, try this:
script.Parent.Touched:connect(function(Hit) if Hit and Hit.Parent and Hit.Parent.Name ~= 'wave' then print(Hit.Parent.Name) for i,v in next, Hit.Parent:GetChildren() do if v:IsA('BasePart') then v.CFrame = v.CFrame + Vector3.new(0,-10,0) end end end end)
If it moves the parts, that means the parent name isn't 'wave' thus proving my other posts correct. |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Oct 2013 04:26 PM |
It's funny, cause what you did is simply call hit Hit and add an if statement. Now that helps (applause etc)
+ What you just posted will make anything that is NOT called wave move.
Herr advanced Scriptor |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 13 Oct 2013 04:29 PM |
It does help. I changed it to 'Hit' because I like to capitalize my variables. I added an if statement because if one of the children isn't a base part that means it doesn't have a CFrame, which means the script would error.
"+ What you just posted will make anything that is NOT called wave move."
Please read my FULL post before saying something stupid like this. |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 04:30 PM |
Still nothing I changed the model's name to 'a' |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
| |
|
| |
|