Alright so I am wondering if there is a way to disable keycodes on the roblox inventory. I am going to go ahead and assume without this disclaimer there would be many people saying “Disable viewing the inventory and make a custom” “Just make a custom inventory”, now I would do that if i had the time but atm i don’t have enough time to do it.
So if you are wondering what I mean, I mean like if you press “1” item 1 pops up. Is there a way to disable you being able to press keys to open items so i am able to do a temporary method of just clicking whatever key you have set in the keybinds.
Are you sure though? I looked through the wiki and googled it, I googled like 6 different things related to it, I even searched through the devforum. Nothing related to it
It’s not a matter of unbinding keys so much as it is unequipping the tools as soon as they are equipped. For whatever the reason may be you can’t unbind the number keys so that simply isn’t an option.
Instead opt for a solution that looks a bit like this.
First we need to get all the tools a player has in their inventory when they spawn (tools in starterpack), and then verify that their Class is Tool.
for _,tool in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
if tool:IsA("Tool") then
tool.Equipped:Connect(function()
game:GetService("RunService").RenderStepped:Wait()
game.Players.LocalPlayer.Character.Humanoid:UnequipTools()
end)
end
end
Now we need to detect when the tool is equipped, which is as simple as this:
for _,tool in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
if tool:IsA("Tool") then
tool.Equipped:Connect(function()
end)
end
end
Lastly, we need to unequip the tool, while also adding in the tiniest weight so that we don’t receive any errors (ex: unknown attempted to set parent)
for _,tool in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
if tool:IsA("Tool") then
tool.Equipped:Connect(function()
game:GetService("RunService").RenderStepped:Wait()
game.Players.LocalPlayer.Character.Humanoid:UnequipTools()
end)
end
end
And huzzah, the script is completed!
Very barebones though, if you want to go even further in-depth you can add a sort of “bypass” system that prevents any item from being equipped when a number key is pressed prior - allowing the player to still equip via clicking the hotbar icon, or through a UserInput connection.
This script doesn’t work for me because of mobile players and i have my inventory specifically coded to my needs, i dont have anything in starterpack after the player clicks deploy on the main menu it gives them a forcefield for 1 second then takes it away and gives them their weapons
However I kinda get the script but i think it really depends on uip instead of equipped due to how mine works but i get the script, Thanks
Yeah ik, Even though it doesn’t look like it because I don’t pay attention to how the inventory system works I can do top level scripting so connecting it to uip is a peace of cake