|
| 26 Jul 2017 01:41 PM |
Hey I am having a problem giving the player back ammo..
The set up i have it is like this
In the main script the "StoredAmmo is linked to a "ModuleScript" but now I can't give the player ammo back... I need help.!
GunSettings.StoredAmmo = GunSettings.StoredAmmo * GunSettings.MagCount (Code from main script)
local Settings = { Ammo = 32; StoredAmmo = 32; MagCount = 10; (Code From ModuleScript)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 28 Jul 2017 08:59 AM |
dont store the ammo in a module.
just use simple local variables.
local ammo = 30 local clip = 120
like this. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2017 09:01 AM |
or use a global variable.
_G[player.Name.."table"] = {}
local ammostorage = _G[player.Name.."table"]
ammostorage.Ammo = 30 ammostorage.Clip = 120
etc, etc... |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Jul 2017 09:10 AM |
| dont add onto the global table if you don't need to |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2017 07:49 AM |
Worked but still can't changes the players ammo or give a player ammo..
|
|
|
| Report Abuse |
|
|