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 to Make the sound only for the player?

Previous Thread :: Next Thread 
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
19 Jan 2016 12:22 PM
when this script is on, the sound when you hit a coin sounds for all players in the game, HOw Do I make it so only the person hitting the brick hears a sound.

local Players = game:GetService("Players")
local Sound = script.Parent.Victory

local Touched = function(hit)
if hit.Parent then
if Players:GetPlayerFromCharacter(hit.Parent) then
Sound:Play()
end
end
end

for i,v in next, script.Parent:GetChildren() do
if v:IsA("BasePart") and v.Name == "Part" then
v.Touched:connect(Touched)
end
end
Report Abuse
WealthyDrakor is not online. WealthyDrakor
Joined: 15 Dec 2011
Total Posts: 654
19 Jan 2016 12:23 PM
Ternous, could you please help me?
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
19 Jan 2016 12:26 PM
play it client side or server side from backpack/playergui will probably also work
Report Abuse
WealthyDrakor is not online. WealthyDrakor
Joined: 15 Dec 2011
Total Posts: 654
19 Jan 2016 12:26 PM
yeah playing from playergui works
Report Abuse
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
19 Jan 2016 08:04 PM
What do I edit in it to make it play just for the player who hits the brick?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
19 Jan 2016 08:05 PM
...you play the sound inside the player, playergui or backpack
Report Abuse
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
19 Jan 2016 08:09 PM
so change this line

Sound:Play()

to this

Sound:Play:FindFirstChild("StarterGUI")
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
19 Jan 2016 08:10 PM
sound.Parent = player
sound:Play()
Report Abuse
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
19 Jan 2016 08:11 PM
is this correct?

local Touched = function(hit)
if hit.Parent then
if Players:GetPlayerFromCharacter(hit.Parent) then
sound.Parent = player
Sound:Play()
end
end
end

for i,v in next, script.Parent:GetChildren() do
if v:IsA("BasePart") and v.Name == "Part" then
v.Touched:connect(Touched)
end
end
Report Abuse
NecroBumpism is not online. NecroBumpism
Joined: 25 Nov 2015
Total Posts: 534
19 Jan 2016 08:14 PM
no, it's not. do you know how to script?
Report Abuse
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
19 Jan 2016 08:35 PM
not really someone made it for me.
Report Abuse
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
19 Jan 2016 09:42 PM
bump
Report Abuse
Ternous is online. Ternous
Joined: 22 Oct 2012
Total Posts: 1748
20 Jan 2016 01:16 AM
bump please help
Report Abuse
Soybeen is online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
20 Jan 2016 01:36 AM
If you didn't understand the previous explanations, please don't bump anymore, lol.

You need to fire the sound locally, either from the Player, or the StarterGui, or some other locally-held area.

Be curious about it, use the wiki:
http://wiki.roblox.com/index.php?title=Sounds#Playing_Sound


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