hi, I’m making a plugin that requires you to click parts, but because of this, studio automatically makes you select the part. How do I disable the Select, Move, Scale, and Rotate tool?
I guess you can use Selection Service to manage the selection state of parts.
All you need to do is:
game.SelectionService:Remove(game.SelectionService:Get())
Then just make sure obviously that the :Remove function is on a pcall, since a player could be selecting something that isn’t locked. And also check to make sure Get() has something.
Example:
local SelectionService = game.Selection
-- Makes sure :Get() isn't just {}
if next(SelectionService:Get()) ~= nil then
local success, err = pcall(function()
return SelectionService:Remove(SelectionService:Get())
end)
if not success then
warn(err)
end
end
I’ve fully tested it. Remove will not destroy it, it will unselect the actual part/object
Sorry for the necro bump, but wouldn’t it make more sense to, rather than remove the selection. To set the Selection to an empty table?
--Makes sure :Get() isn't just {}
if next(SelectionService:Get()) ~= nil then
--Set Selection to empty table
SelectionService:Set({})
end