HELP: I am trying to make a collectable gun in my game

I already have all the code for my gun, it looks like this:

I am attempting to make it so that you can’t shoot or see any of the UI for your gun until you pick it up, can anyone help me with this? Am Confused

Also, I don’t really understand as to how I am supposed to make it so when I pick up the gun model, code for the pickup able gun:

1 Like

You want a gun that the player can grab and drop?

Sorry for the late response, didn’t see this.

So you want to pick the gun up and…? I’m unsure what you’re asking
Did you want to drop your current gun and then have the sprite of the new gun, or just completely replace the old gun? Any additional details would be helpful.

Also a side note, you should try organizing and bundling your code better. I made a guide a while ago that will help your code a ton with just some basic implementation

Ok so I have got the code down by doing a lot of trial and error, so basically what I was wanting to ask for was when you pick up a sprite of a gun, it outputs all the code for the gun into the player. The earlier problem that I had was having my gun code in my player code, which meant the player would always be able to shoot, so I had just moved the gun code into a separate sprite. Thanks for trying to help!
Also if any of yall can help me with creating a save feature, where you can save your progress so you don’t have to restart the game, because I am pretty confused with it.
If you want to check out my code, here is the link:

1 Like

Also extremely sorry for the bad question, I was typing the question at like 1 am trying to code my game…

1 Like

I’m going to be gone soon, I’ll try to see in the morning.

Tips for the Save behavior though:

Make sure to name it properly. If you name it “Health” you need to use that exact same name to get that value. If you did “health” it would not work because it’s case sensitive.

The “Save” input saves that value. If you input 20 into “Save”, using the “Read” input would cause it to output 20 (the value that was just saved)