I’ve been having a bit of trouble figuring out on what to do to let a player equip their weapon using the button “E” without the weapon taking up any space in the 0-9 backpack slots, similar to the system used in the game TYPE://SOUL. Anyone got any ideas on what I should do?
If I get what you’re saying, you can use this method.
Create a Local Script in StarterGui or places where they will run, and disable the Backpack GUI like this: game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Create your tool and put it in the starterpack or backpack of the player. (You won’t see it appear on your screen though, which means clicking 0-9 won’t do anything.) Then, in the local script where you want to equip your specific tool, use UserInputService to detect Button Press (E) as shown:
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local toolName = "Tool" -- Replace with the name of your tool
local ToolForEquipping = player.Backpack:FindFirstChild(toolName) --This basically checks to see if it's in your backpack or not.
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
if ToolForEquipping then
if ToolForEquipping.Parent == player.Backpack then
-- Equip the tool
player.Character.Humanoid:EquipTool(ToolForEquipping)
elseif ToolForEquipping.Parent == player.Character then
-- Unequip the tool
player.Character.Humanoid:UnequipTools()
end
end
end
end)
Yep! Definitely. Everything will always be in the backpack folder, so you can just look for the tools there, using something like: local tool = game.Players.LocalPlayer.Backpack:WaitForChild("ToolName")
(That is if you place the tools there. This means it will be just like if you had the toolbar 0-9 GUI, but now you don’t. So work with it in your head as if it’s invisible if you get what I mean.)