배우기
엔진 클래스
MessagingService
만들 수 없음
서비스
복제되지 않음

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


요약
메서드
PublishAsync(topic: string,message: Variant):()
상속된 멤버

API 참조
메서드
PublishAsync
생성
기능: ServerCommunication
MessagingService:PublishAsync(
topic:string, message:Variant
):()
매개 변수
topic:string
message:Variant
반환
()

SubscribeAsync
생성
기능: ServerCommunication
MessagingService:SubscribeAsync(
topic:string, callback:function
매개 변수
topic:string
callback:function
코드 샘플
크로스 서버 메시지 구독
local MessagingService = game:GetService("MessagingService")
local Players = game:GetService("Players")
local function onPlayerAdded(player)
-- 주제에 구독하기
local topic = "player-" .. player.UserId
local connection = MessagingService:SubscribeAsync(topic, function(message)
print("Received message for", player.Name, message.Data)
end)
player.AncestryChanged:Connect(function()
-- 주제에서 구독 취소하기
connection:Disconnect()
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.