JARAM
|
  |
| Joined: 30 Jul 2010 |
| Total Posts: 139 |
|
|
| 29 Sep 2011 05:08 PM |
-- Skiding the rails! TONYHAWK! TONYHAWK! --
bin = script.Parent
function onTouched(part) local h = part.Parent:FindFirstChild("Left Rear") -- looks for a left rear part if h~=nil then part.Instance.new("Sparkles", part) end end end bin.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2011 05:13 PM |
bin = script.Parent
function onTouched(part) local h = game.workspace.part:FindFirstChild("Left Rear") -- looks for a left rear part if h~=nil then a = Instance.new("Sparkles", game.workspace.part) end end bin.Touched:connect(onTouched)
try that |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2011 05:28 PM |
bin = script.Parent
function onTouched(part) local h = part.Parent:FindFirstChild("Humanoid") -- looks for a left rear part if h and not part:findFirstChild("Sparkles") then Instance.new("Sparkles", part) end end bin.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
JARAM
|
  |
| Joined: 30 Jul 2010 |
| Total Posts: 139 |
|
|
| 29 Sep 2011 05:30 PM |
| If left rear is the name of a part, wil yousing findfirstchild work? |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2011 05:31 PM |
| Just try it out, it'll work. |
|
|
| Report Abuse |
|
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 29 Sep 2011 05:35 PM |
script.Parent.Touched:connect(function(part) local h = part.Parent:findFirstChild("Left Rear") -- looks for a left rear part if (h ~= nil) then local f = Instance.new("Sparkles") f.Parent = part.Torso end end)
|
|
|
| Report Abuse |
|
|
JARAM
|
  |
| Joined: 30 Jul 2010 |
| Total Posts: 139 |
|
|
| 30 Sep 2011 02:19 PM |
will this work?
bin = script.Parent
function onTouched(part) local h = game.workspace.part:FindFirstChild("Left Rear") -- looks for a left rear part if h~=nil then a = Instance.new("Sparkles", game.workspace.part) end end) bin.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2011 02:23 PM |
no you need to take out the "game.workspace" from line 4 and in line 6 "part.Parent" instead of "game.workspace.part"
so it would be like this:
bin = script.Parent
function onTouched(part) local h = part:FindFirstChild("Left Rear") if h~=nil then a = Instance.new("Sparkles", part.Parent) end end bin.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2011 02:25 PM |
and the scripts up are right why are you still asking :P and yea if you changed the name findFirstChild will work. |
|
|
| Report Abuse |
|
|