generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help with Touch insert sparkles script?

Previous Thread :: Next Thread 
JARAM is not online. 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
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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 is not online. 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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
29 Sep 2011 05:31 PM
Just try it out, it'll work.
Report Abuse
slayer219 is not online. 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 is not online. 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
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
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
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image