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: GUI help

Previous Thread :: Next Thread 
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
12 Jul 2015 03:50 PM
I have gui for a gun that says how much ammo you have in a clip (5) and how much ammo in total (75)

I want to make it so that every time you fire the gun, the number goes down.
Also, when you run out of ammo in that clip, it takes the total ammo number down by five.

How would I make this? Help please.
Report Abuse
strongalphawarrior is not online. strongalphawarrior
Joined: 27 Jun 2011
Total Posts: 1000
12 Jul 2015 03:51 PM
Use this event.

http://wiki.roblox.com/index.php?title=API:Class/Tool/Activated


-Baheeg
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
12 Jul 2015 03:53 PM
That only shows how to activate an event. I need to know how to make it change the values.
Report Abuse
strongalphawarrior is not online. strongalphawarrior
Joined: 27 Jun 2011
Total Posts: 1000
12 Jul 2015 03:54 PM
You learn how to script then, youtube a tutorial made by peaspod or friaza


-Baheeg
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
12 Jul 2015 03:56 PM
"youtube a tutorial"

Grammar is fun
Report Abuse
strongalphawarrior is not online. strongalphawarrior
Joined: 27 Jun 2011
Total Posts: 1000
12 Jul 2015 03:58 PM
You understand my point?
Youtube/search a tutorial on youtube


And if we really are going to go by grammar then lol


"youtube a tutorial"

Grammar is fun.--Forgot the dot, hypocrite.


-Baheeg
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
12 Jul 2015 04:14 PM
"YouTube" should not be used as a verb.
Report Abuse
hunxrepair is not online. hunxrepair
Joined: 07 Aug 2011
Total Posts: 777
12 Jul 2015 04:19 PM
local Ammo = 30
local CurrentAmmo = 5



function UpdateAmmo()

CurrentAmmo = CurrentAmmo - 1
if CurrentAmmo == 0 and Ammo > 0 then
CurrentAmmo = 5
Ammo = Ammo - 5

end end



function Fire()
bla bla bla bla
UpdateAmmo()
end


Report Abuse
hunxrepair is not online. hunxrepair
Joined: 07 Aug 2011
Total Posts: 777
12 Jul 2015 04:21 PM
this instead


local Ammo = 30
local CurrentAmmo = 5



function UpdateAmmo()

CurrentAmmo = CurrentAmmo - 1
if CurrentAmmo == 0 and Ammo > 0 then
CurrentAmmo = 5
Ammo = Ammo - 5

-- let's check if we took more ammo than we have
if Ammo < 0 then
CurrentAmmo = CurrentAmmo - Ammo
Ammo = 0
end
end end



function Fire()
bla bla bla bla
UpdateAmmo()
end
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