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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 07 Oct 2016 08:38 PM |
| Then make a looping sound. Spend a few extra ROBUX, god. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|