Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i force The Player to hold a tool without it being in the hotbar?

Asked by 3 years ago

Hello, I'm trying to make a fps game and was wondering how to make a tool that forces you to hold it and removes the hotbar at the bottom. I'm fairly new to scripting but know the basics. Anything would help. thanks!

1 answer

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
3 years ago
Edited 3 years ago

So I hope you know about welds because this is how you would do it without a tool.

In order to make a tool without a "tool", you would need to get the model that would be inside the tool, and weld it yourself how you would if the player was to use it in a tool. Then to get input and handle functions of the gun, you don't actually need a tool and the new UserInputService actually makes it easier now to handle input without a tool.

So to summarize: Weld the gun to the player's body however you want it to look, and use the UserInputService to handle player input.

https://developer.roblox.com/en-us/api-reference/class/UserInputService

Edit: with the UserInputService, there would be no hotbar and you wouldn't need it because the UserInputService is what allows you to keybind things, so you can make like 3 different guns and have them selected when you press 1 2 or 3. All this with only the UserInputService. And if you wanted a gui like the hotbar, you could just make a gui visible when you activate a weapon.

0
Is there anyway to make the hotbar invisible but still have access? OneRedStar 4 — 3y
0
Use UserInputService to handle player input (like keybinds) User#30567 0 — 3y
0
thanks for the help OneRedStar 4 — 3y
0
I've updated my answer to explain better, and don't forget to mark it as accepted. SteamG00B 1633 — 3y
Ad

Answer this question