FPS Gun Loadout

If a player has more than 2 tools in the backpack, it’ll throw out the second tool and replace it with the tool that the player took
if the boolvalue in any frame is true and one of the two tools stringvalue is connected to that frame, then it’ll replace the tool that is connected to the frame that has the true boolvalue

Frame1’s stringvalue in the tool will be 1
Frame2’s stringvalue in the tool will be 2

Like in back 4 blood, or other fps games (at least most of them)

Note: Forgive me if I worded it bad, feel free to ask if you don’t know what I’m trying to say

1 Like

So basically you just want to be able to switch between primary and secondary weapons?

yep, pretty much

let’s say, both of the slots has a gun in it and the player want’s to switch it

when the player takes the Tool(gun) then it’ll replace the slot that is currently selected (basically, the slot that has the bool value set to true)

In this case, Slot2 has it’s Selected boolvalue set to true, so then it simply replaces the tool has has the string value connected to it

if one of the slots is empty (represented by the hasGun boolvalue), then it’s a free spot waiting to be taken by a tool without throwing the other tool
Slot1 stringvalue is 1
Slot2 stringvalue is 2

Black = Slot1 and Slot2 (starting from the top)
Red = tool
Blue = player

hopefully those who didn’t understand, now understood with the illustration

Ah, I get it. You can check the player’s character for the selected gun and then destroy that and set the new gun’s parent to the player’s character.

but, how would I check the stringvalue of the tools the player currently has, as well has the boolvalue of the frames?

Edit: I know how to do this, but it’ll the plain, so I also wanted to know how to I apply a bit of “force” to launch the gun backwards a bit? rather than deleting the gun the player has, I just want to parent it to workspace and launch it backwards

Then add a VectorForce to the tool after it has been parented to workspace and set the Force to Vector3.new(0,-100,0)