Hi guys, this is my first question and I am really new to scripting. How can I force a player to hold an item at all times? like they could switch items but could not hold nothing. Thanks for your help!
EDIT:
I have the code to do this, BUT removing the backpack means that I cant give players items in scripts. Anyone have alternate methods or ideas on how to do this???
EDIT #2:
How can players switch between multiple items with the backpack disabled? Anyone know how to do that with scroll or keybinds???
Hello ChainMailZombie, you can disable the player's backpack using the StarterGui class. This will disable the player from using the default backpack system.
void SetCoreGuiEnabled ( CoreGuiType coreGuiType, bool enabled )
You can then call the SetCoreGuiEnabled function from the StarterGui object to disable the player's default backpack.
-- Grab reference to StarterGui so you can use the class from the Roblox's API local StarterGui = game:GetService("StarterGui") -- Disable the default backpack system StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
From there you can use the UserInputService that Roblox provides on there API to check for input events on the keyboard such as InputBegan or InputEnded.
It could get really complex or you can make it pretty basic with just keyboard input to change the player's current Tool. If you have more questions I would gladly help. I just gave you some hints on how to start your task.