Sargeant12344 Posted March 4, 2016 Share Posted March 4, 2016 How would I make music play from the very start of the game to the end? I know this this is a noob question. Quote Link to comment Share on other sites More sharing options...
extenz Posted March 4, 2016 Share Posted March 4, 2016 Put a pivot anywhere on your map, create a script, attach the script to the pivot you just created and copy & paste the code below. Script.Music = "" --path "Music" "Waveform Audio File Format (*.wav):wav|Sound" function Script:Start() local music = Sound:Load(self.Music) self.source = Source:Create() self.source:SetSound(music) self.source:SetLoopMode(true) self.source:Play() end You should see something like this in the "Script" tab of the pivot you created. So just set it to whatever you want and you're good to go ! You could also add something like this ( in the updatephysics function ) to mute / unmute Quote Link to comment Share on other sites More sharing options...
Sargeant12344 Posted March 4, 2016 Author Share Posted March 4, 2016 I'm having an issue where it says "attempt to index global 'Script' (a nil value) Line 2 I can confirm that I do have a working piece of music selected. Quote Link to comment Share on other sites More sharing options...
Angelwolf Posted March 4, 2016 Share Posted March 4, 2016 You can use the built-in Noise script to do this too, when attached to a pivot Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
cassius Posted March 4, 2016 Share Posted March 4, 2016 in c++ you load the sound file then.... source = Source::Create(); source->SetSound(sound); source->SetLoopMode(true); source->Play(); not too different in lua I think. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Sargeant12344 Posted March 4, 2016 Author Share Posted March 4, 2016 Managed to slove the problem by using the prebuilt Noise script Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.