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
 

Gun Building ~[Reload Help]~

Previous Thread :: Next Thread 
UGAGODOGS1 is not online. UGAGODOGS1
Joined: 14 Oct 2010
Total Posts: 485
14 Oct 2012 09:31 PM
Hello there, I am wondering..
I am making a gun for my clan. I watched a roblox tutorial on how to make a gun, and I was practicing and such. As I was almost done, the video ends and says the will be the final part soon, yet its been 2 months. That left out the main part: How to reload. Basically, I am unaware of how to make your weapon reload. If needed, I can make the gun a free model and someone can look into it and tell me what to put, because i think the reload is programmed into the gun. Or we can talk about it, I just need some assisstance. Thank you.

~The Dawg~
Report Abuse
xSIXx is not online. xSIXx
Joined: 06 Aug 2010
Total Posts: 9202
14 Oct 2012 09:49 PM
out.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
14 Oct 2012 10:04 PM
Reloading is it basically adding ammo into the gun. So just give the gun's ammo value equal more than 0.
Report Abuse
UGAGODOGS1 is not online. UGAGODOGS1
Joined: 14 Oct 2010
Total Posts: 485
14 Oct 2012 10:06 PM
How can I make that in a script, what line of code can I use?

~The Dawg~
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
14 Oct 2012 10:09 PM
Depends on your gun.

Try reading the mathematics part on here:

http://wiki.roblox.com/index.php/Operators

Which explains how to use math in Lua (scripts).
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
15 Oct 2012 05:41 AM
local Ammo = 20
local RTime = 0.075

function Reload()
local Max = 20
for i=1, Max-Ammo do
wait(RTime)
Ammo = Ammo + 1
end end

Well, that's one way. You'd need to connect it to a key that you're using to reload with, and you would need to show the player how much ammo they have. (And honestly, you could just set the Ammo to the Max value, as if you're changing magazines.

There are probably a hundred ways you can approach reloading. I think the reload script I used for my guns is actually less efficient than the one I showed you... Although, I had to prevent some loop holes in the script. Such as preventing the player from reloading 5 times at once.

"Contact me if you are interested in becoming a developer, innovator, or recruiter for CSA."
Report Abuse
Garnished is not online. Garnished
Joined: 09 Apr 2012
Total Posts: 12695
15 Oct 2012 07:21 AM
GOBWEY.
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