Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

4 comments

0

Is there anyway to make the hotbar invisible but still have access?

0

Use UserInputService to handle player input (like keybinds)

0

thanks for the help

0

I've updated my answer to explain better, and don't forget to mark it as accepted.

This discussion is preserved as it was. New answers, comments, and votes are closed.