Trying to create a tree placer plugin. This is my very first attempt. The problem is, it does not even print "Clicked" when I press anywhere in studio after clicking the plugin in the plugins tab.

--@author FiredDusk

local Toolbar = plugin:CreateToolbar('Tree')
local Mouse = plugin:GetMouse()


--// Settings
local Button = Toolbar:CreateButton(
	'Tree placer',
	'Place trees',
	'729458963'
)

--// Functions
print('Loaded?')

function PlaceTree()
	local Tree = script:FindFirstChild('Tree')
	local NewTree = Tree:Clone()
	NewTree.Parent = workspace
	NewTree.PrimaryPart.CFrame = Mouse.Hit.p
end

--// Main
Mouse.Button1Down:Connect(function()
	print'Clicked'
	PlaceTree()
end)

2 comments

0

plugin:Activate(true) -- Neccessary to listen to mouse input

0

Where would that go at though?