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

How Would I Disable All Tools in a Player's Backpack?

Asked by 5 years ago

I have made loops for other things similar to this, but I just need to know the general format for going through each tool in a player's current backpack (not starterpack!) and turning off their "Enabled" property. Thanks in advance.

2 answers

Log in to vote
2
Answered by 5 years ago
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

This line of code will allow you to disable every tool. You can use this again and set "false" to "true" at any time to re-enable all tools.

0
That was hot. Thank you! corncob567 275 — 5y
0
Well, actually it didn't "Disable" them...not if you have them selected before the GUI disappears. corncob567 275 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

I don't get what you mean but maybe this thing will work

local Player = game.Players[""]-- Your player

for i, Toolsxd in pairs(Player.Backpack:GetChildren()) do
    if Toolsxd:IsA("Tool") then
        Toolsxd.Enabled = false
    end
end
0
Oh sorry, in A player backpack, Lemme edit. FixRobloxz 61 — 5y

Answer this question