How would I go on making a tool disabling and reenabling for a gun round game

So basically i tried this
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

but if the player has their tools before open then they can still use them

1 Like

Use Humanoid:UnequipTools() to force a player to unequip their tools.

3 Likes

but how would I make them reequip it since this is a roundbased game

1 Like

The complement of :UnequipTool is Humanoid:EquipTool(tool)

3 Likes

wait but there s a problem actually for equip tools I wouldnt knwo what tools they had since equip tools has a parameter is their a way to equip alltools?

1 Like

Oh its not working
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.Humanoid:UnequipTools()
end)
end)

What’s not working? Do you have a tool at the beginning so that the script can unequip it?

local PreviouslyEquiped = {}

local function RemoveTools()
    for _, Player in pairs(game.Players:GetPlayers()) do
        local Character = Player.Character
        local Humanoid, Tool = Character and Charcater:FindFirstChild("Humanoid"), Character and Character:FindFirstChildOfClass("Tool")
        if Humanoid and Tool then
           PreviouslyEquipped[Player] = Tool
           --You'd want to add something here, like firing a remote to disable their toolbar
           Humanoid:UnequipTools()
        end
    end
end

local function EquipPrevious()
    for _, Player in pairs(game.Players:GetPlayers()) do
        local Character = Player.Character
        local Humanoid = Character and Charcater:FindFirstChild("Humanoid")
        if Humanoid and PreviouslyEquipped[Player] then
           --You'd want to add something here, like firing a remote to enable their toolbar
            Humanoid:EquipTool(PreviouslyEquipped[Player])
        end
    end
end
2 Likes

You don’t have to worry about knowing which tools they have, if you disable their Backpack* it doesn’t delete the tools they have. It just hides the backpack.

Yes I do Im doing a test with the starterpack

so I could Juist disable the backpack?

Yes sir, that just doesn’t get rid of the current tool they have in hand.

1 Like