Help with publish async

hi everyone I need some help here;

local suc,er = pcall(messagingservice.PublishAsync,'Practice',messagingservice,{Name = matchName,Key = key})

This is error;
19:00:48.916 false Expected ‘:’ not ‘.’ calling member function PublishAsync - Server - PracticeMatchmatching:34

The way you were calling it was messagingservice.PublishAsync('Practice',messagingservice,{Name = matchName,Key = key}) but when calling a function with :, self is always passed as the First argument (in this case, messagingservice.) Without the pcall it would look like messagingservice:PublishAsync(topic,message) or messagingservice.PublishAsync(messagingservice,topic,message)

local suc,er = pcall(messagingservice.PublishAsync,messagingservice,'Practice',{Name = matchName,Key = key})
1 Like