pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 08 Jul 2015 07:36 PM |
Supposed to be when the player touches an explosion brick.
How can I get this to go into the players gui to who touches it, so only they can hear it?
script.Parent.Ring:Play() script.Parent.Ring.Volume = 1 wait(3) script.Parent.Ring.Volume = .95 wait(2) script.Parent.Ring.Volume = .80 wait(2) script.Parent.Ring.Volume = .70 wait(2) script.Parent.Ring.Volume = .60 wait(2) script.Parent.Ring.Volume = .50 wait(2) script.Parent.Ring.Volume = .40 wait(3) script.Parent.Ring.Volume = .30 wait(3) script.Parent.Ring.Volume = .20 wait(3) script.Parent.Ring.Volume = .10 wait(3) script.Parent.Ring.Volume = .09 wait(3) script.Parent.Ring.Volume = .08 wait(3) script.Parent.Ring.Volume = .07 wait(3) script.Parent.Ring.Volume = .06 wait(3) script.Parent.Ring.Volume = .05 wait(3) script.Parent.Ring.Volume = .04 wait(4) script.Parent.Ring.Volume = .03 wait(4) script.Parent.Ring.Volume = .02 wait(4) script.Parent.Ring.Volume = .01 script.Parent.Ring:Pause() |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|
|
| 08 Jul 2015 07:44 PM |
| Try cloning the sound into the local player. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2015 07:46 PM |
function onTouched(hit) local Humanoid = hit.Parent:findFirstChild("Humanoid") if Humanoid ~= nil then Sound:clone().Parent = game.Players.LocalPlayer end end game.Workspace.Part.Touched:connect(onTouched)
Make the script local so that it will be easier |
|
|
| Report Abuse |
|
|
pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 08 Jul 2015 09:23 PM |
Yes, but the sound needs to go down in volume, not just play.
Playing this audio at its max volume would be too painful. ;-; |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2015 09:58 PM |
Insert this after it clones
for i = 1, 10 do -- Will repeat 10 times in order to get the volume to lower wait(.1) Sound.Volume = Sound.Volume - .1 end |
|
|
| Report Abuse |
|
|
pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 09 Jul 2015 03:42 PM |
local sound = script.Ring -- should sound be defined here? idk
function onTouched(hit) local Humanoid = hit.Parent:findFirstChild("Humanoid") if Humanoid ~= nil then Sound:clone().Parent = game.Players.LocalPlayer for i = 1, 10 do -- Will repeat 10 times in order to get the volume to lower wait(.1) Sound.Volume = Sound.Volume - .1 end
game.Workspace.Part.Touched:connect(onTouched) _-_-_-_ I Get this under the last line of the script on the red squiggliys~~~
Expected end to close then' at line 5, got eof -- #Unexpected error with your request Please try again after a few moments. #CrapRoblox |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 09 Jul 2015 03:59 PM |
script.Parent.Ring:Play() for =1,0,-.5 do script.Parent.Ring.Volume=i wait(math.random(1,4)) end script.Parent.Ring:Stop() |
|
|
| Report Abuse |
|
|