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 » Scripting Helpers
Home Search
 

Re: Gun Question (fire sound)

Previous Thread :: Next Thread 
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 06:40 PM
I'm making a gun. Everytime their is a Mouse1Down it goes through the standard bullet firing function. I just added a Fire sound in the handle, and it plays everytime you click/hold down.

Since my gun is automatic, I want the sound to play everytime you click OR hold it down (like a real gun would sound). Anyone know how to do this?

sound settings:
Archivable = true
Looped = false
PlayOnRemove = false
Report Abuse
HardCoreRecon is not online. HardCoreRecon
Joined: 23 Aug 2010
Total Posts: 3379
26 Sep 2014 06:42 PM
Wait, what is this?
AntiFiter, you're not dead?

Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 06:44 PM
AntiIsDead = false
Report Abuse
HardCoreRecon is not online. HardCoreRecon
Joined: 23 Aug 2010
Total Posts: 3379
26 Sep 2014 06:45 PM
Sup bro, it's Cubyfan2 from C&G.

Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 06:46 PM
Oh hey cuby.

You happen to know how do to my original question?

You know how whenever you shoot a raycast gun, no matter how fast, it plays the sound in the Handle over and over? Yeah, that's what I'm wondering how to do, because I can hold it down for 5 seconds and use 20 bullets, but the sound only plays after.
Report Abuse
Hunter4529 is not online. Hunter4529
Joined: 20 Oct 2013
Total Posts: 675
26 Sep 2014 06:47 PM
Just add sound:Play() to your loop?
Report Abuse
HardCoreRecon is not online. HardCoreRecon
Joined: 23 Aug 2010
Total Posts: 3379
26 Sep 2014 06:48 PM
Yeah just add sound:Play() to the loop.

Trouble w/ Exploiters At Your Base? Having Issues With Your LinkedSword? Use This Sword & Script Provided by The Sword Clan Community: http://www.roblox.com/---item?id=179203012 - Cubyfan2 & Cubyfan22 | Add 23,481 Posts
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 06:51 PM
Here is a bit of code

Mouse.Button1Down:connect(function()
if Can_Shoot and Ammo.Value > 0 and Character.Humanoid.Health > 0 then
Mouse_Held = true
while true do
script.Parent.Handle.Fire:play()
Can_Shoot = false

It still has the same result
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 07:22 PM
bump
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
26 Sep 2014 07:33 PM
you could do something like

repeat
sound:play()
wait(0.1)
until held == false

Or whatever
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 07:42 PM
@Crow

I'll try that out in a second but I think the problem is that the Sound can only :play() once at a time, and keeps resetting the :play() for every time you click.
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
26 Sep 2014 10:29 PM
anyone happen to know
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
27 Sep 2014 11:32 AM
anyone happen to know
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
27 Sep 2014 12:27 PM
b
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
27 Sep 2014 01:05 PM
does anyone happen to know
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
27 Sep 2014 01:28 PM
If I changed the pitch to 10 it can go through the sound fast enough to play it in .1 seconds.

I need to figure out how to OVERLAP the same sound
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
27 Sep 2014 01:29 PM
Sound:Stop()
Sound:Play()
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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