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: Weird sound error

Previous Thread :: Next Thread 
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
07 Oct 2016 12:50 PM
So I have this gun that has a sound in the handle, the sounds volume is up, everything about it is normal.

When I fire the gun the sound clones as expected and the cloned sound is placed in the handle as well. It makes no noise. Every other sound it working, and I know the sound isn't broken because I have tried the url of the asset, which works, and I have used it in other tools without problems.

I even made the sound loop to make sure it was playing, and of course "Playing: true" but yet still no sound


Any ideas on what could be causing this?
Report Abuse
Soybeen is online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
07 Oct 2016 01:00 PM
Yes, inadequate know-how :P
Just:Play() the sound instead of cloning it, make sure it's not looping
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
07 Oct 2016 08:37 PM
It's a gun, if I just :Played() it, then there would be inaccurate sounds. If you just play it every time you fire the gun, if you fire it rapidly it sounds extremely stupid.
Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
07 Oct 2016 08:38 PM
Then make a looping sound. Spend a few extra ROBUX, god.
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
07 Oct 2016 08:40 PM
And I'm Playing()ing the clone too:

ShootSound.Pitch = 1
local s = ShootSound:Clone()
s.Parent = ShootSound.Parent
s:Play()
game.Debris:AddItem(s, 5)

And as expected it clones the sound, and it says that the sound is playing when I check it. The handle is a child of the character, which is obviously a child of the workspace, and it very close to the player firing the gun.


The audio also is a real working audio. There is no explanation that I can see that would be causing this
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
07 Oct 2016 08:42 PM
Real are you an idiot?

This has absolutely nothing to do with looping audio, it has to do with a cloned sound making no sound at all when everything suggests that it should be.
Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
07 Oct 2016 08:48 PM
"if you fire it rapidly it sounds extremely stupid."

That's the problem I was addressing, not your main one. I've had seemingly idiopathic errors before. The best remedy is probably to either 1) start over, or 2) come back to it in a bit if it's not breaking anything else.
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
07 Oct 2016 08:56 PM
Well the thing is I've just been trying to fix a model that I didn't make to begin with.

The script seems to be functioning perfectly, based on tests I have done. The real problem I think is in some sort of weird error with the game itself or Roblox, not the script.

This is the model if you want to look at it:

https://www.roblox.com/library/401842032/Smith-Wesson-M-P-40

The Shoot() function in the GunHandler script is where the shooting sound is created.
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
07 Oct 2016 08:58 PM
just note that the asset id of the sound in that model was changed to the shooting sound from this model in my situation:

https://www.roblox.com/library/407294167/M-P-40-FPS-V3
Report Abuse
Soybeen is online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
08 Oct 2016 11:55 AM
Just make a new sound and remove it each time.
This is scripting 101

s = Instance.new('Sound',tool.Handle)
s.SoundId = 'rbxassetid://'..YourIDHere
s.Volume = 1
s.Looped = false
s:Play()
game:GetService'Debris':AddItem(s,s.TimeLength)


Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
08 Oct 2016 10:24 PM
And cloning a sound doesn't work why?

Like I said when testing it in game EVERYTHING works except the physical sound. The sound object is all correct and everything else works.

It's really not that complicated to understand what I'm saying
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