|
| 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
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 27 Sep 2011 10:50 AM |
:clone()'s parent is nil
~Y U FLOODCHECK MEH! ლ(ಠ益ಠლ) |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2011 10:52 AM |
How to make it work?
-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 27 Sep 2011 10:57 AM |
Where to implement? This is my first plugin :D
-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 27 Sep 2011 12:30 PM |
Lol... I've had a duplicate button in my studio for ovar a year .-.
Regards, ~Scarfacial |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2011 12:44 PM |
xD. Just trying to make it myself...
-NEVAR, EVAR EVAR EVAR, FEED TEH TROLL. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 27 Sep 2011 12:47 PM |
Try adding print(selection.className) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|