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: Copy plugin: :clone() method is no longer working?

Previous Thread :: Next Thread 
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
27 Sep 2011 10:47 AM
self = PluginManager():CreatePlugin()
mouse = self:GetMouse()
selection = game.Selection:Get()
toolbar = self:CreateToolbar("Copy")
toolbarbutton = toolbar:CreateButton("Copy", "Copier", "add.png")
toolbarbutton.Click:connect(function()
selection:clone()
end)



-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
27 Sep 2011 10:50 AM
:clone()'s parent is nil

~Y U FLOODCHECK MEH! ლ(ಠ益ಠლ)
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
27 Sep 2011 10:52 AM
How to make it work?

-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
27 Sep 2011 10:52 AM
selection.Parent = game.Workspace

That what you're lookin for?
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
27 Sep 2011 10:57 AM
Where to implement? This is my first plugin :D

-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL.
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
27 Sep 2011 11:12 AM
self = PluginManager():CreatePlugin()
mouse = self:GetMouse()
selection = game.Selection:Get()
toolbar = self:CreateToolbar("Copy")
toolbarbutton = toolbar:CreateButton("Copy", "Copier", "add.png")
toolbarbutton.Click:connect(function()
selection:clone().Parent = workspace
end)



Try that

~SS9875|Programmer|Web Engineer|Wiki Writer
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
27 Sep 2011 11:15 AM
Same error. Seems to be trying to eradicate :clone() as a method.

-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL.
Report Abuse
Fredfishy is not online. Fredfishy
Joined: 21 Mar 2009
Total Posts: 4197
27 Sep 2011 12:01 PM
Try changing it to "Clone".
ROBLOX seems to be removing some of the lower case versions of things.
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
27 Sep 2011 12:30 PM
Lol... I've had a duplicate button in my studio for ovar a year .-.

Regards,
~Scarfacial
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
27 Sep 2011 12:44 PM
xD. Just trying to make it myself...

-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL.
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
27 Sep 2011 12:45 PM
And still refuses to work. Attmpted to call method 'Clone' (a nil value)

-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL.
Report Abuse
Fredfishy is not online. Fredfishy
Joined: 21 Mar 2009
Total Posts: 4197
27 Sep 2011 12:47 PM
Try adding
print(selection.className)
Report Abuse
AntiBoomz0r is online. AntiBoomz0r
Joined: 02 Oct 2009
Total Posts: 1345
27 Sep 2011 12:56 PM
Well...

First of all, :Get() returns a table, not an object.
Secondly, you need to :Get() it every time you press the button, otherwise it will never update
Thirdly, you dont need the "mouse"...


self = PluginManager():CreatePlugin()
toolbar = self:CreateToolbar("Copy")
toolbarbutton = toolbar:CreateButton("Copy", "Copier", "add.png")
toolbarbutton.Click:connect(function()
selection = game.Selection:Get() -- Moved this here
if #selection == 0 then return end -- If selection table is empty, stop the function
selection[1]:Clone().Parent = workspace -- [1], taking first thing from the table you get from :Get()
end)
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
27 Sep 2011 02:17 PM
I'd personally do it like this:

self = PluginManager():CreatePlugin()
toolbar = self:CreateToolbar("Copy")
toolbarbutton = toolbar:CreateButton("Copy", "Copier", "add.png")
toolbarbutton.Click:connect(function()
for i,v in pairs(game.Selection:Get()) do
local new = v:clone()
new.Parent = game.Workspace;
if new:IsA("BasePart") or new:IsA("Model") then new:MoveTo(v.Position); end
end end)

That way it moves the part/model to just above the existing one, similar to the clone tool.

Regards,
~Scarfacial
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
27 Sep 2011 02:22 PM
Err... the script I posted would error if you tried to clone a model. But you get the point :P

Regards,
~Scarfacial
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