Hello, I am trying to make a plugin like F3X but I don’t know how to detect the developer’s / User’s Input.B
“Building Tools by F3X” has a way of detecting when the player/dev clicks a Part, or press a key on the keyboard. Can you please help with this because it is really confusing. Here is the code for more detail:
local IsOn
PluginButton.Click:Connect(function()
IsOn = not IsOn
PluginButton:SetActive(IsOn)
GUI.Enabled = IsOn
end)
local Mouse = game.Players.LocalPlayer:GetMouse()
while wait() do
script.Select.Adornee = Mouse.Target
Mouse.Button1Down:Connect(function()
if Mouse.Target then
script.Select.SelectedBox.Adornee = Mouse.Target
end
end)
end
(Select is the hover selection box and Selected Box is the selected part’s selection box…)
local GUI = script.Parent.CreatePartGUI
local ScrollFrame = GUI.Frame.ScrollingFrame
GUI.Parent = game.CoreGui
local IsOn
PluginButton.Click:Connect(function()
IsOn = not IsOn
PluginButton:SetActive(IsOn)
GUI.Enabled = IsOn
local Mouse = plugin:GetMouse()
Mouse.Move:Connect(function()
script.Select.Adornee = Mouse.Target
Mouse.Button1Down:Connect(function()
if Mouse.Target then
script.Select.SelectedBox.Adornee = Mouse.Target
end
end)
end)
end)
local GUI = script.Parent.CreatePartGUI
local ScrollFrame = GUI.Frame.ScrollingFrame
GUI.Parent = game.CoreGui
local IsOn
PluginButton.Click:Connect(function()
IsOn = not IsOn
PluginButton:SetActive(IsOn)
GUI.Enabled = IsOn
local Mouse = plugin:GetMouse()
Mouse.Move:Connect(function()
script.Select.Adornee = Mouse.Target
Mouse.Button1Down:Connect(function()
--[[ LINE 25]]if Mouse.Target then
script.Select.SelectedBox.Adornee = Mouse.Target
end
end)
end)
end)
Well @LoadsOfMoney123 I don’t know either, but if you need it then here is the explorer:
I put the plugin inside starterGUI I hope that isn’t a problem.
Also it is a local plugin and I right click the folder not the script
local GUI = script.Parent.CreatePartGUI
local ScrollFrame = GUI.Frame.ScrollingFrame
GUI.Parent = game.CoreGui
local IsOn
PluginButton.Click:Connect(function()
print("Button clicked")
IsOn = not IsOn
PluginButton:SetActive(IsOn)
GUI.Enabled = IsOn
local Mouse = plugin:GetMouse()
Mouse.Move:Connect(function()
print("Mouse Moved")
script.Select.Adornee = Mouse.Target
Mouse.Button1Down:Connect(function()
print("Mouse clicked")
--[[ LINE 25]]if Mouse.Target then
print("Mouse Target")
script.Select.SelectedBox.Adornee = Mouse.Target
end
end)
end)
end)
local PluginButton = plugin:CreateToolbar("Creepersaur's Plugins"):CreateButton("CreatePart by creepersaur!", "Create a new part!", "rbxassetid://5710391838")
local GUI = script.Parent.CreatePartGUI
local ScrollFrame = GUI.Frame.ScrollingFrame
GUI.Parent = game.CoreGui
local IsOn
PluginButton.Click:Connect(function()
print("Button clicked")
IsOn = not IsOn
PluginButton:SetActive(IsOn)
GUI.Enabled = IsOn
local Mouse = plugin:GetMouse()
Mouse.Move:Connect(function()
print("Mouse Moved")
script.Select.Adornee = Mouse.Target
Mouse.Button1Down:Connect(function()
print("Mouse clicked")
--[[ LINE 25]]if Mouse.Target then
print("Mouse Target")
script.Select.SelectedBox.Adornee = Mouse.Target
end
end)
end)
end)
--[[LINE 37]]GUI.Frame.CreatePart.MouseButton1Click:Connect(function()
local Camera = game.Workspace.Camera
local Part = Instance.new("Part")
local Xpos = ScrollFrame.Xpos.Text
local Ypos = ScrollFrame.Ypos.Text
local Zpos = ScrollFrame.Zpos.Text
Part.Position = Vector3.new(Xpos,Ypos,Zpos)
local R = ScrollFrame.Red.Text
local G = ScrollFrame.Green.Text
local B = ScrollFrame.Blue.Text
Part.Color = Color3.fromRGB(R,G,B)
Part.Parent = workspace
wait()
local LookDirection = CFrame.new(Camera.CFrame.Position, Part.Position)
local NewCFrame = CFrame.new(Camera.CFrame.Position) * LookDirection
Camera.CFrame = Camera.CFrame:lerp(NewCFrame, 1)
Camera.CFrame.Position = Camera.CFrame.Position + Vector3.new(0,23,0)
end)
GUI.Frame.CreateMesh.MouseButton1Click:Connect(function()
local Camera = game.Workspace.Camera
local Part = Instance.new("MeshPart")
local Xpos = ScrollFrame.Xpos.Text
local Ypos = ScrollFrame.Ypos.Text
local Zpos = ScrollFrame.Zpos.Text
Part.Position = Vector3.new(Xpos,Ypos,Zpos)
local R = ScrollFrame.Red.Text
local G = ScrollFrame.Green.Text
local B = ScrollFrame.Blue.Text
Part.Color = Color3.fromRGB(R,G,B)
Part.Parent = workspace
wait()
local LookDirection = CFrame.new(Camera.CFrame.Position, Part.Position)
local NewCFrame = CFrame.new(Camera.CFrame.Position) * LookDirection
Camera.CFrame = Camera.CFrame:lerp(NewCFrame, 1)
Camera.CFrame.Position = Camera.CFrame.Position + Vector3.new(0,23,0)
end)
For some reason It doesn’t work, I deleted all of the mouse stuff, and I added just a script for when you click the plugin button it should just set the adornee of select to the baseplate. When I clicked, NOTHING HAPPENS (it doesn’t set the adornee, the GUI stuff is fine…)
Don’t worry I got it working! (selection boxes do not appear to be working for some reason with a plugin so I used a script to place a block with the EXACT CFrame and size and that seems to be working fine.)
The only problem is when I use a black block to show that you clicked on something using MouseButton1Down it doesn’t work…