API
Methods
changePrefix
Flux:changePrefix(player: Player, prefix: string, color: Color3?): ()
color can be left empty. color will default to white in that case.
Info
This method can only be implemented on the server.
Code Sample
This example checks the users UserId and applies a prefix dependent on it.
local ownerId = 1 -- UserId of the user that is supposed to receive that prefix
local prefix = "[OWNER]" -- Desired Prefix to be applied to Player
local color = Color3.fromRGB(255, 0, 0) -- Color of the Prefix Text
game:GetService("Players").PlayerAdded:Connect(function(player)
if player.UserId == ownerId then
Flux:changePrefix(player, prefix, color)
end
end)
broadcastMessage
Replicates a message to recipient in form of a system message. Supports Rich Text formatting.
Flux:broadcastMessage(recipient: any?, message: string): ()
recipient can either be a Team instance, a Player instance or a table. If recipient is a table, that table will be iterated and every Player instance found will receive the broadcast.
Info
This method can only be implemented on the server.
Code Sample
This example broadcasts a serverwide message to all Players in the server instance.
local players = game:GetService("Players"):GetPlayers()
local message = "This is a serverwide announcement!"
Flux:broadcastMessage(players, message)
Warning
The content of the message is not automatically filtered. This Method should never contain any user generated content!
broadcastGlobalMessage
Replicates a message to every Player across all active game servers of the same experience. Supports Rich Text formatting.
Flux:broadcastGlobalMessage(message: string): ()
Info
This method can only be called from the server.
Warning
The content of the message is not automatically filtered. This Method should never contain any user generated content!
chatBanPlayer
Bans a player from chatting over the Flux Chat System. This includes QuickChatting.
Flux:chatBanPlayer(violator: any, reason: string?): ()
violator can either be an instance of Player or a UserId that belongs to the violator. If a reason isn't specified, reason will default to "No reason specified".
Info
This method can only be called from the Server.
This method will kick the player to ensure the chat ban will be enforced immediately. Banned Players can still see other players' messages.
Code Sample
This example bans a random player from the game server.
local Players = game:GetService("Players"):GetPlayers()
local target = math.random(1,#Players)
Flux:chatBanPlayer(Players[target], "Unlucky guy")
unChatBanPlayer
Unbans a player, enabling them to actively chat over the Flux Chat System again.
Flux:unChatBanPlayer(userId: number): ()
Info
This method can only be called from the Server.
Events
OnIncomingMessage
Called when Flux is receiving a chat message.
Flux.OnIncomingMessage(): message: string, player: Player
message, the messages content that was sent in form of a string and player will pass the Player Instance of the messages author.
Info
This event can only be implemented on the client.
Code Sample
This example will check if the LocalPlayers' DisplayName has been mentioned in a chat message and will print to the output if so.
local LocalPlayer = game.Players.LocalPlayer
Flux.OnIncomingMessage:Connect(function(message, player)
-- Prevents the output if the mention comes from the Player themselves
if player ~= LocalPlayer then
message = string.lower(message)
local LocalPlayerName = string.lower(LocalPlayer.DisplayName)
-- checks if DisplayName is contained in sent message
if string.find(LocalPlayerName, message) ~= nil then
print(player.Name.." has mentioned your name.")
end
end
end)
Configuration Properties
Read the Get Started Section to figure out where to find these configuration properties.
These properties can technically be changed at runtime but it is recommended to either set them beforehand or at the start of the game server.
A dynamic change of some of these properties could lead to unexpected behaviour.
Flux.Enabled
Flux.Enabled: boolean
Flux.Debug
Flux.Debug: boolean
Flux.DisableRobloxChat
Flux.DisableRobloxChat: boolean
Flux.EnableFiltering
Flux.EnableFiltering: boolean
Danger
Disabling this could potentially get your game in trouble.
Flux.EnableProjection
Flux.EnableProjection: boolean
The Projection system enables players to communicate with eachother, even though they wouldn't normally be able to due to account settings.
For the Projection system to work, a projector in form of another player in the same game server is required. This projector needs the ability to chat and will automatically be selected when this feature is enabled.
graph LR
A[Player1] -->|Can't chat| B{Player2};
A -->|Communicates inability to chat| C[Server];
C -->|Finds Projector| D[Player3];
D -->|Projects/Masks Message| B;
Danger
Enabling this could potentially get your game in trouble.
Flux.EnableUserChecking
Flux.EnableUserChecking: boolean
Danger
Disabling this could potentially get your game in trouble.
Flux.ChatBehaviour_ChatCache
Flux.ChatBehaviour_ChatCache: boolean
Danger
Enabling this could potentially get your game in trouble.
Expand to read why
The Chat Cache stores the messages that are sent in the Flux Chat on the server. If a player chats, their message stored in the chat cache and then they leave, I have no way of checking if that person is allowed to chat with any player that joins the server now. I could technically only display the previous messages of players that are still in the game server, as this lets me check the validity of that action but it also kind of removes the functionality of the chat cache. As Roblox' new content sharing rule under age groups is very undocumented (in my opinion), I'm simply marking this as possibly risky to ensure there's no misunderstandings.
Flux.ChatBehaviour_MaximumMessageLength
Flux.ChatBehaviour_MaximumMessageLength: number
Flux.ChatBehaviour_MaximumMessages
Flux.ChatBehaviour_MaximumMessages: number
Flux.ChatBehaviour_JoinMessage
Flux.ChatBehaviour_JoinMessage: boolean
Flux.ChatBehaviour_LeaveMessage
Flux.ChatBehaviour_LeaveMessage: boolean
Flux.EnableUtilities
Flux.EnableUtilities: boolean
Flux.Utilities_QuickChat
Flux.Utilities_QuickChat: boolean
Flux.Utilities_QuickChatMessages
Flux.Utilities_QuickChatMessages: table
Warning
The strings in these tables will not be filtered! If you as a developer break ToS by adding inappropiate messages, that's 100% on you!
Flux.EnableAntiSpamming
Flux.EnableAntiSpamming: boolean
Flux.AntiSpamming_MaxMessages
Flux.AntiSpamming_MaxMessages: number
Flux.AntiSpamming_Cooldown
Flux.AntiSpamming_Cooldown: number
Flux.AntiSpamming_DetectSpammers
Flux.AntiSpamming_DetectSpammers: boolean