So, um... I have a script that I was wanting to locally play music when you touch it and stop playing all other sounds, but I don't know how to make it local and the music doesn't play.
function OnTouch (hit) workspace.Sounds.ambient.stop() workspace.Sounds.musicambient.stop() workspace.Sounds.engine.play() end
A function only ever runs when you call it or connect it to an event. To call a function you would simply do:
OnTouch(item)
in your script and it would run the function. If you want to tie your function to an event you would do:
script.Parent.Touched:Connect(OnTouch)
This tells Roblox that whenever the "Touched" Event of script.Parent
fires, call that function.