- Home /
Disable Weapons Until Bought FPS Creator Kit
Hey there everyone. So I'm using the FPS Creator Kit and I'm trying to make a system in which you have to buy the guns with points in order to use them. The only issue is that I'm not too sure how to disable the other weapons until you buy them. As of right now, I have 4 different types of weapons which can be used by pressing the 1,2,3,4 keys. Is there some way to disable guns that I have yet to buy? Below is the part of the script that I'm having trouble.
for (int i = 0; i < startingWeapons.Length; ++i)
{
PickupWeapon(startingWeapons[i]);
}
for (int i = 0; i < startingAmmo.Length; ++i)
{
ChangeAmmo(startingAmmo[i].ammoType, startingAmmo[i].amount);
}
m_CurrentWeapon = -1;
ChangeWeapon(0);
for (int i = 0; i < startingAmmo.Length; ++i)
{
m_AmmoInventory[startingAmmo[i].ammoType] = startingAmmo[i].amount;
}
I just need help disabling weapons when I don't have them and enabling them when I buy them. Any and all help is appreciated. Thank you!
I'm going to post the full script below if you think that'd easier.
Google Drive Link - https://drive.google.com/file/d/1uXTorV1BG20zpDd1El9GiiNSmFYPI-n8/view?usp=sharing
The link you provided doesn't work.
Can you walk me through why the code you provided in your post is controlling what you want to eventually do, because to me it looks like a script to get the ammo and gun the player has picked up.