Nahupai Posted June 1, 2020 Share Posted June 1, 2020 is there any way to make an object move to the rhythm of the music? Link to comment
Administrators Tut Posted June 1, 2020 Administrators Share Posted June 1, 2020 It's better asked in the Scripting section, moving there. Link to comment
Hydra Posted June 1, 2020 Share Posted June 1, 2020 mysong = playSound3D("song.mp3", 2050.0209960938, 1510.056640625, 10.671875, true) setSoundMaxDistance(mysong, 100) local a = 0 local myObject = createObject(1775, 2050.0209960938, 1510.056640625, 10.671875, -0, 0, 178.50372314453) local ox, oy, oz = getElementPosition(myObject) function animateObject() local animMusic = 0+math.random(-a,a) moveObject(myObject, 1000, ox, oy+animMusic, oz) end addEventHandler("onClientRender", getRootElement(), animateObject) function asd() if mysong then local leftData, rightData = getSoundLevelData(mysong) if (leftData) then a = 3*(leftData/3000) end end end addEventHandler("onClientRender", getRootElement(), asd) Link to comment
Nahupai Posted June 3, 2020 Author Share Posted June 3, 2020 On 1/6/2020 at 14:53, Hydra said: what I want is that I move to put music with a converted link. (example "music download link") and that is created in the place where the player started the command. Link to comment
Zorgman Posted June 4, 2020 Share Posted June 4, 2020 I think this is what you need: https://wiki.multitheftauto.com/wiki/GetSoundWaveData Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now