TextChatService يحتوي على أوامر دردشة مدمجة لأغراض شائعة، مثل كتم صوت اللاعبين الآخرين واستخدام إيماءات الشخصية. يمكنك تفعيلها عن طريق تعيين CreateDefaultCommands إلى true في نافذة الخصائص في الاستوديو.
يمكنك أيضًا إضافة أوامر مخصصة باستخدام TextChatCommand. يقوم المستخدمون الذين يرسلون أمرًا معرّفًا في شريط إدخال الدردشة بتفعيل رد نداء محدد بواسطة TextChatCommand.Triggered لأداء إجراءاتك المخصصة.
يوضح المثال التالي كيفية إنشاء أمر دردشة يسمح للاعبين بزيادة أو تقليل حجم شخصيتهم عند إدخال /super أو /mini.
أضف مثيل TextChatCommand داخل TextChatService.
أعد تسميته إلى SizeCommand.

قم بتعيين خاصية PrimaryAlias إلى /super و SecondaryAlias إلى /mini.

أدخل Script التالية داخل ServerScriptService لتعريف رد نداء لأمر الدردشة الذي يقوم بتغيير حجم الشخصية:
Scriptlocal TextChatService = game:GetService("TextChatService")local Players = game:GetService("Players")local sizeCommand: TextChatCommand = TextChatService:WaitForChild("SizeCommand")sizeCommand.Triggered:Connect(function(textSource, message)local scaleMult = 1local messageWords = string.split(message, " ")if messageWords[1] == "/super" thenscaleMult = 2elseif messageWords[1] == "/mini" thenscaleMult = 0.5endlocal player = Players:GetPlayerByUserId(textSource.UserId)if player thenlocal character = player.Characterif character thenlocal humanoid = character:FindFirstChildWhichIsA("Humanoid")if humanoid thenfor _, child in humanoid:GetChildren() doif child:IsA("NumberValue") thenchild.Value *= scaleMultendendendendendend)