Hi, I’m @RuizuKun_Dev,
I made a plugin that Sets ALL BasePart.Locked to either true or false depending on the button you press and will also set for newly added BaseParts to workspace.
Why would anyone need this?
From my experience as a Game Developer, you do not want to accidentally drag your entire workspace or a big model and working in TeamCreate with a Builder can require Parts to be Locked and Unlocked
so to make that easy for the both of us I have created this plugin and decided to share it with whom ever may need be.
Resources
https://www.roblox.com/library/4581199986/Toggle-BasePart-Locked
Source Code
local toolbar = plugin:CreateToolbar("Toggle BasePart.Locked")
local UnlockBtn = toolbar:CreateButton("Unlock ALL BaseParts", "BasePart.Locked = false", "rbxassetid://4581192102")
local LockBtn = toolbar:CreateButton("Lock ALL BaseParts", "BasePart.Locked = true", "rbxassetid://4581192286")
local LockNewBaseParts;
UnlockBtn.Click:Connect(function()
LockBtn:SetActive(false)
for _,v in ipairs(workspace:GetDescendants()) do
if v:IsA("BasePart") then
v.Locked = false
end
end
LockNewBaseParts = false
UnlockBtn:SetActive(true)
-- print("ALL BaseParts Are Unlocked")
end)
LockBtn.Click:Connect(function()
UnlockBtn:SetActive(false)
for _,v in ipairs(workspace:GetDescendants()) do
if v:IsA("BasePart") then
v.Locked = true
end
end
LockNewBaseParts = true
LockBtn:SetActive(true)
-- print("ALL BaseParts Are Locked")
end)
workspace.DescendantAdded:Connect(function(AddedDescendant)
if AddedDescendant:IsA("BasePart") then
AddedDescendant.Locked = LockNewBaseParts
end
end)
Toggle BasePart.Locked - Plugin.lua (1.0 KB)