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 » Scripting Helpers
Home Search
 

HOW DO I MAKE A SONG PLAY onTouch()????

Previous Thread :: Next Thread 
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
11 Oct 2014 07:32 PM


undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
11 Oct 2014 07:33 PM

function onTouch()
wait(4)
Game.Workspace.Sound:Play()

end

ik its wrong :(
undefined
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
11 Oct 2014 07:34 PM
yourpart.Touched:connect(function()
game.Workspace.yoursong:Play()
end)

Make sure you song has loop set to true if you want it to loop
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
11 Oct 2014 07:35 PM
function onTouched()

wait(4)
workspace.Sound:Play()
end

workspace.PartName.Touched:connect(onTouched)
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
11 Oct 2014 07:35 PM
ok thanks ill try it

undefined
Report Abuse
Haggie125 is not online. Haggie125
Joined: 02 Apr 2008
Total Posts: 761
11 Oct 2014 07:36 PM
Either that, or add this to the end

game.Workspace.Button.Touched:connect(onTouched) --Calls onTouched function
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
11 Oct 2014 07:37 PM
@cool it worked thanks

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
11 Oct 2014 07:44 PM
Ive added multiple parts. And I wanted the old sound to stop playing when the new sound is activated so I wrote this>




function onTouched()

wait(4)
workspace.ROSS2:Stop()

workspace.ROSS3:Play()
end

workspace.PART2.Touched:connect(onTouched)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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