Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with a basic plugin script that does not print?

Asked by
FiredDusk 1466 Moderation Voter
7 years ago
Edited 7 years ago

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)

0
plugin:Activate(true) -- Neccessary to listen to mouse input Filipalla 504 — 7y
0
Where would that go at though? FiredDusk 1466 — 7y

Answer this question