السلام عليكم انا قاعد اشتغل على مود الميكروفون الوكل يعني بس الي قريب مني ب 50 متر يسمع جمعت الكود بس كيف اركبه
local range = 50
addEventHandler ( "onClientPlayerVoiceStart", root,
function()
if (source and isElement(source) and getElementType(source) == "player") and localPlayer ~= source then
local sX, sY, sZ = getElementPosition(localPlayer)
local rX, rY, rZ = getElementPosition(source)
local distance = getDistanceBetweenPoints3D(sX, sY, sZ, rX, rY, rZ)
if distance <= range then
voicePlayers[source] = true
else
cancelEvent()
end
end
end
)