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: In need of help

Previous Thread :: Next Thread 
ekideki is not online. ekideki
Joined: 27 Nov 2010
Total Posts: 88
28 Apr 2013 07:01 AM
I've recently started to learn how to script, and just can't understand how to make a script to clone a part when an other part touches it. Any help, please?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
28 Apr 2013 07:11 AM
script.Parent.Touched:connect(function(hit)
if hit.Parent:IsA("Part") then
script.Parent:Clone().Parent = Workspace
end
end)
Report Abuse
ekideki is not online. ekideki
Joined: 27 Nov 2010
Total Posts: 88
28 Apr 2013 07:17 AM
I can't make it work. :/
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
28 Apr 2013 07:37 AM
Put it in the part....
Report Abuse
ekideki is not online. ekideki
Joined: 27 Nov 2010
Total Posts: 88
28 Apr 2013 07:48 AM
I did, I'm not that stupid. :P
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
28 Apr 2013 07:52 AM
script.Parent.Touched:connect(function(hit)
if hit.Parent:IsA("Part") then
script.Parent:Clone().Parent = game.Workspace
end
end)
--------------------------------------------------------

or try this one

--------------------------------------------------------
Workspace = game.Workspace
script.Parent.Touched:connect(function(hit)
if hit.Parent:IsA("Part") then
script.Parent:Clone().Parent = Workspace
end
end)
---------------------------------------------------------
He didn't define workspace although.. if you were to shortcut it, i'd be 'workspace' not 'Workspace'
so

---------------------------------------------------------
script.Parent.Touched:connect(function(hit)
if hit.Parent:IsA("Part") then
script.Parent:Clone().Parent = workspace
end
end)

----------------------------------------------------------
enjoy :)
Report Abuse
ekideki is not online. ekideki
Joined: 27 Nov 2010
Total Posts: 88
28 Apr 2013 11:37 PM
Ok, thanks. :)
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 11:39 PM
Why the heck are you guys check if what hit it has a parent that is a part?
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 11:41 PM
Also @Ban
Workspace or workspace both work, same with game and Game
(If you used Game.Workspace it would have to be Workspace not workspace though)
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
29 Apr 2013 02:19 PM
@Unbuild
It never works like that for me, every time i've tried doing..
workspace
never works, just no output, and no effect.. maybe it's a client glitch.. -.- Might look into this deeper hmm...
Report Abuse
pauljkl is not online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
29 Apr 2013 02:58 PM
Workspace and workspace are global variables.

script.Parent.Touched:connect(function(hit)
if hit:IsA("BasePart") then
script.Parent:Clone().Parent = workspace
end
end)
Report Abuse
ekideki is not online. ekideki
Joined: 27 Nov 2010
Total Posts: 88
30 Apr 2013 07:04 AM
Thanks paul, that's the only cloning script working for me so far. :P
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
01 May 2013 10:25 AM
All my ones work, and they're laid out how I put them -.-
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
01 May 2013 11:41 AM
No yours doesn't work
Yours will check if the part parent is a part.
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