|
| 18 Mar 2016 01:49 PM |
So, in my game, you need to be able to find magazines to increase the ammo that you are carrying. I have a stored ammo value in the gun, which controls the amount of ammo that you have before you run out. So the magazine needs to be able to change that value. I think the easiest way would be to make the magazine a tool that, when used, changes the value and destroys itself. Does anyone have any way to do this?
Sorry for the long post :/
|
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Mar 2016 07:18 AM |
??
Why not have it so when the player gets within X distance of a magazine he picks it up?
requiredDistance = 5 distance = (part1.Position - part2.Position).Magnitude if distance < requiredDistance then pickUpMag() end
|
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 07:47 AM |
| Sounds good, but my problem is that I dont know how to change the StoredAmmo value. |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 08:58 AM |
StoredAmmo.Value = StoredAmmo.Value + newAmmo.Value
|
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 10:57 AM |
| I have lots of different guns and I need it so each type of gun uses a different magazine. How would I do that? There would need to be a way to specify which storedammo value to change. |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 11:51 AM |
You can make it so that each bunch of weapons with the same ammo type use the same value etc.
|
|
|
| Report Abuse |
|
|
|
| 20 Mar 2016 10:55 AM |
| I will do that, but I need to know how. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 23 Mar 2016 02:25 PM |
| Last bump before new string. |
|
|
| Report Abuse |
|
|
| |
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 25 Mar 2016 07:47 PM |
Why don't you make a touch event?
As for the stored ammo, its really just basic math. |
|
|
| Report Abuse |
|
|