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: Change Value tool

Previous Thread :: Next Thread 
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
19 Mar 2016 07:15 AM
Bump
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
19 Mar 2016 07:47 AM
Sounds good, but my problem is that I dont know how to change the StoredAmmo value.
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
19 Mar 2016 08:58 AM
StoredAmmo.Value = StoredAmmo.Value + newAmmo.Value


Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
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
arshiaslaya is not online. arshiaslaya
Joined: 04 Nov 2012
Total Posts: 2670
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
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
20 Mar 2016 10:55 AM
I will do that, but I need to know how.
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
22 Mar 2016 04:56 PM
Bump.....
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
22 Mar 2016 05:03 PM
Bump......
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
23 Mar 2016 02:25 PM
Last bump before new string.
Report Abuse
FancyPig19 is not online. FancyPig19
Joined: 23 Sep 2014
Total Posts: 269
25 Mar 2016 07:44 PM
I'm making a new thread.
Report Abuse
lululukas is not online. 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
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