|
| 11 Oct 2014 05:37 PM |
How to make a script where if you click on a Part, it plays music? This is my script. lol fail
function onClicked() Workspace.Sound.SoundId = 167541984 end
Indian of ATR |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Oct 2014 05:40 PM |
no one asked for your life story
Indian of ATR |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:41 PM |
| Go back there and try harder |
|
|
| Report Abuse |
|
|
Ludipup
|
  |
| Joined: 28 Dec 2013 |
| Total Posts: 4347 |
|
|
| 11 Oct 2014 05:41 PM |
my life story:
i was born
the end
Watch out, I'm Bonnie! |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:41 PM |
| I'm not at a computer so I can't help much, but did you put a ClickDetector object in the part? It's what will allow you to click it. |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:42 PM |
| this is why i dont go on scripting helpers anymore. |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 11 Oct 2014 05:42 PM |
rofl i laugh when people say stuff like "Scripting helpers is dead"
It's not dead. |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:42 PM |
@XILOST, I'm not scripter but I'll try. :l
Indian of ATR |
|
|
| Report Abuse |
|
|
nacker
|
  |
| Joined: 06 Oct 2009 |
| Total Posts: 6034 |
|
|
| 11 Oct 2014 05:43 PM |
put a clickdetector in the part and use this function onClicked() Workspace.Sound:Play() end script.Parent.ClickDetector:connect(onClicked)
|
|
|
| Report Abuse |
|
|
Krimulous
|
  |
| Joined: 17 Mar 2011 |
| Total Posts: 7993 |
|
|
| 11 Oct 2014 05:44 PM |
ur first script wasnt bad but uh ur a little confused also the function doesnt have to be named onClicked just for it to work so here ill give u instructions put a ClickDetector inside the part you want clicked
then put a script inside the part (NOT CLICKDETECTOR) then paste this
local part = game.Workspace.Part local sound = game.Workspace.Sound
part.ClickDetector.MouseClick:connect(function() sound:Play() end)
settle down easy jim |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:44 PM |
First off
The Sound ID wont just accept ID's
You need the asset link with it with quotations around it.
You also need to use this command
Play() |
|
|
| Report Abuse |
|
|
drtrollr
|
  |
| Joined: 11 May 2013 |
| Total Posts: 10888 |
|
| |
|
|
| 11 Oct 2014 05:46 PM |
Do I put the asset link inside the parentheses or outside of the parentheses?
Indian of ATR |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:50 PM |
function onClicked() Workspace.Sound.SoundId = 167541984 end
first you need a way to start the sound' and onclicked is not a function because it doesnt tell when you get clicked' so much wrong with this
add a clickdetector and there is already a preset function for onclicked
share ur thoughts below!!11 and dotn forget to offer on 26k rap!! |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:53 PM |
local part = game.Workspace.Part local sound = game.Workspace.Sound
function onClicked() Workspace.Sound.SoundId = 167541984 end
lol not working
Indian of ATR |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 05:58 PM |
local part = game.Workspace.Part local sound = game.Workspace.Sound
function onClicked() Workspace.Sound.SoundId = 167541984 sound:Play() end
game.Workspace.Part.onclick:connect(OnClicked)
share ur thoughts below!!11 and dotn forget to offer on 26k rap!! |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 06:03 PM |
| What script do I paste it in? Local or normal script? |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2014 06:11 PM |
normal
take a part and put a clickdetector in it and then put the script in clickdetectior
share ur thoughts below!!11 and dotn forget to offer on 26k rap!! |
|
|
| Report Abuse |
|
|