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
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
Use Humanoid:UnequipTools()
to force a player to unequip their tools.
but how would I make them reequip it since this is a roundbased game
The complement of :UnequipTool
is Humanoid:EquipTool(tool)
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?
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
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.