Trying to make a hotbar with Primary, Secondary, and Other Hotbar Slots, and the weapons can't be unequipped

Hey Devs,
I am trying to make a hotbar where you can only have primary, secondary, and other weapon slots. I also want it so you cant unequip the weapons, like Arsenal or Bad Business. Also, when someone buys a gun using a proximity prompt that I have, I want it to switch out one of the guns that they currently have equipped in that slot. It’s kind of hard to explain, so I’m sorry about that. If anyone knows how to do this, help would be much appreciated!

3 Likes

This is just a guess but maybe have three folders in the player’s backpack, one for primary, secondary and other. Then when you add a new weapon in add an object value to the corresponding folder. Have a script that detects children added and affect the weaponry equipped from there.

You could also have one folder and have three object value primary, secondary and other. Do the same thing but change the object value and detect for object value changes.

You will also need to save this via a datastore.

1 Like

alright thanks for the help. This makes a little sense in my head so that’s good!

1 Like

I added folders to the backpack, but if a tool is in a folder in the backpack, it doesn’t show in the hotbar, so what else should I do?

Object values should be in a folder that create tools when selected that go in the backpack. You could instead of using tools use welds and attach it to your body and add a script that does special things if you have a certain value equipped.

The welds is much more complicated but could look a bit nicer (Eliminates the generic Roblox hot bar)

1 Like

ohhh ok. also, is it possible to go more in depth about the welds?

Well, you make all of the tools models and set their primary parts to the handle. Then create welds between the parts of the model one weld connects two parts. Set the part0 to weld parent and part1 to the other part to create a weld. Then create a part on the player’s hand where the weapon should be placed and set the cframe of the primary part to there and weld it to the part.

I have not tried this before but these are the ideas I have come up with for the RPG I am making. I have no idea if this will work, but please share the results.

1 Like

so i’m using a gun system with a viewmodel, would this method still work?

What exactly is a view model? Does it set your camera?

1 Like

a viewmodel is like arms that show on your screen, basically first person arms heres a screenshot of it

edit - also the gun model is inside of the viewmodel

edit 2 - the tool is just a invisible handle with scripts in it and some values, no model inside of the actual tool

To do this with the welds you could at some parts to the weld like a camera part that sets the camera when equipped and a counter part that displays the counter (Only shown on a local script).

1 Like

Now that you show me a picture you probably do not need the welds because you have already gotten rid of the Roblox hot bar and that was the main purpose of the welds

1 Like

ohhh ok, so what would you recommend doing now?

When you add an object value to the folder have a script that adds a the object values value to the player’s backpack

1 Like

wait thats kinda confusing could you go more in depth or explain a little better (sorry)

So have a script that detects when the primary, secondary and other value is changed. If it does change add the value of that value to the generic player’s backpack because that is seen. (Also move the folder to just in the player not the player’s backpack)

1 Like

alright i still don’t understand (cuz i’m really dumb lol) but thank you so much for your help, i really appreciated it!