Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer
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.

2 comments

0

That was hot. Thank you!

0

Well, actually it didn't "Disable" them...not if you have them selected before the GUI disappears.

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

1 comment

0

Oh sorry, in A player backpack, Lemme edit.

This discussion is preserved as it was. New answers, comments, and votes are closed.