It derives from a simple copy plugin that did not work.
I adjusted it to work, but I keep getting a line 5 error
self = PluginManager():CreatePlugin()
mouse = self:GetMouse()
mouse.Button1Down:connect(function() onClicked(mouse) end)
self.Deactivation:connect(function()
Off()
end)
toolbar = self:CreateToolbar("Clone")
toolbarbutton = toolbar:CreateButton("", "clone", "Wand.png")
toolbarbutton.Click:connect(function()
if on then
Off()
else
On()
end
end)
function onClicked(mouse)
if on then
if mouse.Target ~= nil then
part = mouse.Target
partt = part:clone()
partt.Parent = game.Workspace
l = part.Position.y + part.Size.y
partt.Position = Vector3.new(x,l,z)
end
end
end
function On()
self:Activate(true)
toolbarbutton:SetActive(true)
on = true
end
function Off()
toolbarbutton:SetActive(false)
on = false
end |