<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

Roblox Luau tilidan foydalanib, qanday qilib men uchun eng yaqin bo'lgan belgilarni topadigan skriptni yarataman, keyin meni o'sha belgiga teleport qilaman? Eng yaqin bo'lgan belgilarni olish uchun alohida funksiya yarating va uni asosiy kodga qo'shing.<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Bu erda eng yaqin belgi topish uchun kod: ``` funksiya findNearestCharacter() lokal belgilar = o'yin.Workspace:GetChildren() lokal myPos = o'yin.Players.LocalPlayer.Character.PrimaryPart.Position lokal yaqinroqCharacter = nil lokal yaqinroqDistance = math.huge uchun i, belgi juftlar (((characters) do if character:IsA (("Model") va belgi ~= game.Players.LocalPlayer.Character keyin mahalliy masofadan = (characters.PrimaryPartition.Position - myPos).Magnitude masofadan agar <yaqinroqDistance keyin yaqinroqCharacter = yaqinroqDistance = masofadan oxirida oxirida yaqinroq qaytishCharacter oxirida ```<|eot_id|><|start_header_id|>user<|end_header_id|>

Javob murakkab ko'rinadi, osonroq yozuv bormi?<|eot_id|>