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: How can I get this script to happen for one player?

Previous Thread :: Next Thread 
pawnz is not online. 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 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
08 Jul 2015 07:38 PM
dear god
Report Abuse
TwistedMemories is not online. TwistedMemories
Joined: 08 Jul 2013
Total Posts: 565
08 Jul 2015 07:44 PM
Try cloning the sound into the local player.
Report Abuse
TwistedMemories is not online. TwistedMemories
Joined: 08 Jul 2013
Total Posts: 565
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 is not online. 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
TwistedMemories is not online. TwistedMemories
Joined: 08 Jul 2013
Total Posts: 565
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 is not online. 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 is not online. 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
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