Sending separate server messages depending on device (Mobile/PC)

I’m using the DisplaySystemMessage from TextChatService in order to send automated and informative messages in chat from the server; the system works perfectly fine. What I’m trying to do is make a separate set of messages that would only be sent to PC users, and another set that will only be sent to Mobile players.

The messages would differ with wording like with tapping/clicking, as well as more significant changes when it comes to tips and explaining gameplay. basically I’m trying to separate the server messages by platform so the information is more accurate to the player

I could not find documentation for being able to detect the players platform. Is there a way to do this so I can send differentiating server messages to specific devices, while not sending it to others?

A simple yet effective way would be checking with UserInputService on the client.

local uis = game:GetService("UserInputService")

if uis.KeyboardEnabled then
    print("PC")
elseif uis.TouchEnabled and not uis.KeyboardEnabled then
    print("Mobile")
else
    print("Console")
end
1 Like

Tested this on both mobile and PC, and works perfectly with the server chat system. This is awesome, thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.