Hi, so my text wont appear in chat could someone help? I think its a issue with the new chat system I’m not sure also no errors in output.
Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local TextService = game:GetService("TextService")
local MessagingService = game:GetService("MessagingService")
local RemotesFolder = ReplicatedStorage:WaitForChild("RemotesFolder")
local MessageEvent = RemotesFolder:WaitForChild("MessageEvent")
local function Color3toString(Color)
return string.format("rgb(%d, %d, %d)", Color.R * 255, Color.G * 255, Color.B * 255)
end
MessageEvent.OnServerEvent:Connect(function(Player, InfoTable)
MessagingService:PublishAsync("GlobalChat", {
InfoTable[1],
InfoTable[2],
Color3toString(InfoTable[3]),
Player.UserId
})
end)
MessagingService:SubscribeAsync("GlobalChat", function(ReceivedData)
if ReceivedData then
local InfoTable = ReceivedData.Data
local Player = Players:GetPlayerByUserId(InfoTable[4])
for i, LoopedPlayer in pairs(Players:GetPlayers()) do
local FilteredString, Obj = pcall(function()
return TextService:FilterStringAsync(
`{Player.Name} Just Got <font color="{InfoTable[3]}">{InfoTable[1]}</font> Which Has A Chance Of <font color="{InfoTable[3]}">1 in {InfoTable[2]}</font>`,
Player.UserId,
Enum.TextFilterContext.PublicChat
)
end)
if not FilteredString then return end
local FilterSuccess, Result = pcall(function()
return Obj:GetChatForUserAsync(LoopedPlayer.UserId)
end)
if FilterSuccess then
MessageEvent:FireClient(LoopedPlayer, Result)
end
end
end
end)
ModuleScript:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemotesFolder = ReplicatedStorage:WaitForChild("RemotesFolder")
local MessageEvent = RemotesFolder:WaitForChild("MessageEvent")
local TweenService = game:GetService("TweenService")
local TInfo = TweenInfo.new(.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local TInfo2 = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local ClickSound = script:WaitForChild("Click")
local function AnimateRarityText(TextLabel : TextLabel, TextLabel2: TextLabel, RolledTable)
TextLabel.Position = UDim2.fromScale(.5, .45)
TextLabel.TextColor3 = RolledTable[3]
TextLabel.Text = RolledTable[1]
TextLabel2.Text = `1 in {RolledTable[2]} Chance`
ClickSound:Play()
TweenService:Create(TextLabel, TInfo, { Position = UDim2.fromScale(.5, .5) }):Play()
wait(.2)
end
local function LegendaryAnimation(AnimationItems: Frame)
local RadialGradient = AnimationItems:WaitForChild("RadialGradient")
local Star = AnimationItems:WaitForChild("Star")
AnimationItems.Visible = true
Star.Visible = true
RadialGradient.Visible = true
Star.Size = UDim2.fromOffset(350, 350)
Star.ImageTransparency = 1
Star.Rotation = 8
RadialGradient.Size = UDim2.fromScale(3, 3)
TweenService:Create(Star, TweenInfo.new(10, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
Rotation = 1700,
ImageTransparency = 0,
Size = UDim2.fromOffset(450, 450)
}):Play()
wait(6)
TweenService:Create(RadialGradient, TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
Size = UDim2.fromScale(1.5, 1.5)
}):Play()
wait(1.7)
AnimationItems.Visible = false
end
local function RareAnimation(AnimationItems: Frame)
local RadialGradient = AnimationItems:WaitForChild("RadialGradient")
local Star = AnimationItems:WaitForChild("Star")
AnimationItems.Visible = true
Star.Visible = false
RadialGradient.Size = UDim2.fromScale(3, 3)
TweenService:Create(RadialGradient, TweenInfo.new(5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
Size = UDim2.fromScale(1.5, 1.5)
}):Play()
wait(4.5)
AnimationItems.Visible = false
end
return {
AnimateRolling = function(AnimationFolder: Frame, AnimationItems: Frame, RolledTable, AnimationSkip)
local Background : Frame = AnimationFolder:WaitForChild("Background")
local Rarity : TextLabel = AnimationFolder:WaitForChild("Rarity")
local Chances : TextLabel = Rarity:WaitForChild("Chances")
AnimationFolder.Visible = true
if AnimationSkip == false then
for i, CurrentTable in ipairs(RolledTable) do
if CurrentTable[5] == "RareAnimation" and i == 8 then
MessageEvent:FireServer(CurrentTable)
RareAnimation(AnimationItems)
AnimateRarityText(Rarity, Chances, CurrentTable)
elseif CurrentTable[5] == "LegendaryAnimation" and i == 8 then
MessageEvent:FireServer(CurrentTable)
LegendaryAnimation(AnimationItems)
AnimateRarityText(Rarity, Chances, CurrentTable)
else
AnimateRarityText(Rarity, Chances, CurrentTable)
end
end
else
AnimateRarityText(Rarity, Chances, RolledTable[8])
end
end,
AnimateRollButton = function(TextButton: TextButton)
local AnimationFrame = TextButton.AnimationFrame
AnimationFrame.Size = UDim2.fromScale(1, 1)
TweenService:Create(AnimationFrame, TInfo2, { Size = UDim2.new(0, 0, 1, 0) }):Play()
end,
}