How Can I Make A Custom Tool Equip Using UIS

Hello, I was wondering how I could make a custom tool equip using UserInputService for my FPS game, also I was wondering how I could make a custom tool unequip as well, thanks for helping! :smiley:

What exactly do you mean by custom tool equip? How do you imagine it would be?

What I mean is I disabled the CoreGUI and I was wondering how I could make a tool equip system without the CoreGUI by using something like UserInputService.

like arsenals? 30charsdobehittinhardtho

Ok I understand now. In order to create such a system you need to code multiple parts. UserInputService will be just a small part to detect (I assume) whether a player clicked on an item or not.

You need to create a backpack-like system for each player.
You need to create GUI to render what the backpack of the player contains
You need to create ways to pick up and throw items (this is where UserInputService comes into play, and it is not the only solution).

So such a system is a bit more complicated.

Yes something like Arsenal’s because I am making an FPS game.

if you want to use tools and not a custom system entirely, you can use EquipTool which is a function of humanoids

Ex.
humanoid:EquipTool(tool)

Aswell as an UnequipTools function which can be used to well, unequip the tool.

(edits to explain more in detail)

So could I do something like this?

game.Players.LocalPlayer.Backpack.G17:EquipTool()

Not quite. For starters this code should be run on the server, what you would do is

Player.Character.Humanoid:EquipTool(Your tool location here)

So run the code on the server like this?

Player.Character.Humanoid:EquipTool(Player:FindFirstChild("G17")))

If you’re storing the tool under the player instance then yes. Just make sure you properly have the player variable set.

So the PlayerVariable being

game:GetService("Players")

no,
but in your case you would probably want to use the PlayerAdded function to get the player

game:GetService(“Players”).PlayerAdded:Connect(function(player)
code here
end)

If you add me on Discord
Cristiano#9363
I can help you out some more

1 Like