You won’t believe this but, in my game, I made a script and when someone sends a message in chat more than 2-4 times, the game won’t crash, the Roblox client itself is missing.
I had to remove this script, to continue the playing of my game.
local tcs = game:GetService("TextChatService")
tcs.OnIncomingMessage = function(message)
if message.Status ~= Enum.TextChatMessageStatus.Success then
return
end
if message.TextSource == nil then
return
end
if message.TextSource.UserId == nil then
return
end
local plr = game.Players:GetPlayerByUserId(message.TextSource.UserId)
if plr ~= nil then
if plr:GetAttribute("PremiumUser") == true then
local newproperties = Instance.new("TextChatMessageProperties")
newproperties.PrefixText = "👑 "..message.PrefixText
return newproperties
elseif plr.MembershipType == Enum.MembershipType.Premium then
local newproperties = Instance.new("TextChatMessageProperties")
newproperties.PrefixText = '<font color="rgb(255,255,255)">'.."\u{E001}</font> "..message.PrefixText
return newproperties
elseif plr.AccountAge%365 == 0 then
local newproperties = Instance.new("TextChatMessageProperties")
newproperties.PrefixText = "🎂 "..message.PrefixText
return newproperties
elseif plr:IsFriendsWith(game.Players.LocalPlayer.UserId) then
local newproperties = Instance.new("TextChatMessageProperties")
newproperties.PrefixText = "🙂 "..message.PrefixText
return newproperties
end
end
end
Why does this happen? It works fine in studio, but in-game it will show its power