-- Gitar çalma event'ini tanımlama addEvent("onPlayerPlayGuitar", true) addEventHandler("onPlayerPlayGuitar", root, function(musicType) local player = source local px, py, pz = getElementPosition(player) local maxDistance = 20 -- Sesin duyulacağı maksimum mesafe (20 metre) for _, otherPlayer in ipairs(getElementsByType("player")) do if otherPlayer ~= player then local ox, oy, oz = getElementPosition(otherPlayer) local distance = getDistanceBetweenPoints3D(px, py, pz, ox, oy, oz) if distance <= maxDistance then triggerClientEvent(otherPlayer, "onPlayerPlayGuitarClient", player, player, musicType) end end end -- Oyuncunun kendisine de sesi çal triggerClientEvent(player, "onPlayerPlayGuitarClient", player, player, musicType) end)