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
 

Sound Script Not Working

Previous Thread :: Next Thread 
jager72 is not online. jager72
Joined: 14 Aug 2010
Total Posts: 11034
21 Dec 2014 12:49 AM
I used this script:

function Song1(playerWhoClicked)
sound = script.Parent.Sound
sound:Play()
end

script.Parent.ClickDetector.MouseClick:connect(Song1)


but when I test it, no sound plays at all. anyone know whats wrong with it?
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
21 Dec 2014 02:02 AM
try this

function Play()
wait(1) -- VVVVV Make sure that is the name of ur sound
sound = game.Workspace.Sound -- Put The Sound In Workspace and the script in workspace :P
sound:Play()
end
script.Parent.ClickDetector.MouseButton1Down:connect(Play)

idk if it will work
Report Abuse
DispenseTheDispenser is not online. DispenseTheDispenser
Joined: 20 Jun 2013
Total Posts: 2268
21 Dec 2014 02:06 AM
w0w m9 wait for the asset to load it wont work instantly lol

also the playerWhoClicked is not needed whatsoever

if problem still persists

here:



local sound = script.Parent.Sound
script.Parent.ClickDetector.MouseClick:connect(function()
sound:Play()
end)
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
21 Dec 2014 02:06 AM
WAITTTTTTTTTTTTTTTTTTTTTTT Error :P

do this one

function Play()
wait(1) -------------- VVVVV Make sure that is the name of ur sound
sound = game.Workspace.Sound -- Put The Sound In Workspace and the script in workspace :P
sound:Play()
end
script.Parent.ClickDetector.MouseClick:connect(Play)

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