Hello everyone, I have a problem. When music is played (random), it is played to all users, but different, how to make it so that it is not different?
Client.lua
tablerand = {
[1] = "soundsMM/1.mp3",
[2] = "soundsMM/2.mp3",
[3] = "soundsMM/3.mp3",
[4] = "soundsMM/4.mp3",
[5] = "soundsMM/5.mp3",
[6] = "soundsMM/6.mp3",
[7] = "soundsMM/7.mp3",
[8] = "soundsMM/8.mp3",
[9] = "soundsMM/9.mp3",
[10] = "soundsMM/10.mp3",
[11] = "soundsMM/11.mp3",
[12] = "soundsMM/12.mp3",
}
resourceRoot = getResourceRootElement()
addEvent("playSoundRound",true)
addEventHandler("playSoundRound",resourceRoot,
function ()
local RandTable = (tablerand[math.random(1,#tablerand)])
sound = playSound(RandTable,false)
end)
function SayChatik ()
local meta = getSoundMetaTags(sound)
local art = 'Артист: '
local tag = '[Legends]'
outputChatBox("[Legends] Artist(s) or track: "..meta.artist.." "..xuesosina1.."")
end
addEventHandler("onClientMapStopping",resourceRoot,SayChatik)
server.lua
function musicround(player)
resourceRoot = getResourceRootElement()
triggerClientEvent(root,"playSoundRound",resourceRoot)
end
addEventHandler ("onRoundFinish", root, musicround)