generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Gun ammo problem..

Previous Thread :: Next Thread 
o0Volvic0o is not online. o0Volvic0o
Joined: 31 Jul 2010
Total Posts: 2291
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
o0Volvic0o is not online. o0Volvic0o
Joined: 31 Jul 2010
Total Posts: 2291
26 Jul 2017 01:59 PM
B1
Report Abuse
o0Volvic0o is not online. o0Volvic0o
Joined: 31 Jul 2010
Total Posts: 2291
26 Jul 2017 02:39 PM
help?
Report Abuse
o0Volvic0o is not online. o0Volvic0o
Joined: 31 Jul 2010
Total Posts: 2291
28 Jul 2017 08:49 AM
B2
Report Abuse
RubyEpicFox is not online. RubyEpicFox
Joined: 02 May 2015
Total Posts: 1828
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
RubyEpicFox is not online. RubyEpicFox
Joined: 02 May 2015
Total Posts: 1828
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 is online. 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
o0Volvic0o is not online. o0Volvic0o
Joined: 31 Jul 2010
Total Posts: 2291
29 Jul 2017 07:49 AM
Worked but still can't changes the players ammo or give a player ammo..
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image