Hi, I know this probably has been answered before, But i am really having a hard time learing how to place in a Chat filter into my game So it doesn't get banned or get me banned. However, i even read the Wiki Roblox And it not really that helpful that i can't understand how exactly to do this. So if anyone can help me what do i need to do to give my game a Chat filter without being evicated.
*I left the scripts below so you can review it.
(This Script is A Normal Script in ServerScriptStorage)
print("The Shadow chat system initializing")
local Utils = assert(LoadLibrary("RbxUtility"))
chat10s = 10
while not _G["GameDatabase"] do wait() end
while not _G["GameDatabase"].ready do wait() end
gamemain = game.Workspace.GameMain
gamedata = gamemain.GameData
ing = gamedata.InGame
gr = gamedata.GameRunning
endt = gamedata.EndType
vl1 = gamemain.Chat1
vl2 = gamemain.Chat2
function pmode(nm)
local fs = ing:findFirstChild(nm)
if fs ~= nil then
local al = fs:findFirstChild("Alive")
if al ~= nil then
if not al:IsA("BoolValue") then return 0 end
if al.Value and endt.Value == "" then
if fs:findFirstChild("beast") ~= nil then
return 2
else
return 1
end
end
end
end
return 0
end
ch_public = {{}, {}, {}, {}, {}, {}}
ch_game = {{}, {}, {}, {}, {}, {}}
function addval(arr, vl)
for i = 1, #arr do
arr[i] = arr[i + 1]
end
arr[6] = vl
end
game.Players.PlayerAdded:connect(function(newPlayer)
local chat_amm = chat10s
while _G["GameDatabase"].pinfo[newPlayer.Name] == nil do
wait()
end
while wait() do
if _G["GameDatabase"].pinfo[newPlayer.Name] == nil then return end
if _G["GameDatabase"].pinfo[newPlayer.Name].ready then
break
end
end
newPlayer.Chatted:connect(function(msg)
if string.sub(msg, 1, 2) == "/e" then return end
if chat_amm == 0 then return end
chat_amm = chat_amm - 1
local pm = pmode(newPlayer.Name)
if pm == 0 then
addval(ch_public, {false, newPlayer.Name, msg})
vl1.Value = Utils.EncodeJSON(ch_public)
elseif pm == 1 then
addval(ch_public, {true, newPlayer.Name, msg})
addval(ch_game, {true, newPlayer.Name, msg})
vl1.Value = Utils.EncodeJSON(ch_public)
vl2.Value = Utils.EncodeJSON(ch_game)
end
wait(10)
chat_amm = chat_amm + 1
end)
end)
gr.Changed:connect(function()
if gr.Value == true then return end
ch_game = {{}, {}, {}, {}, {}, {}}
vl2.Value = Utils.EncodeJSON(ch_game)
end)
(This Script is a local script in a Gui)
wait(0.6)
gamemain = game.Workspace.GameMain
gamedata = gamemain.GameData
ing = gamedata.InGame
ch = gamemain.Chat1
local Utils = assert(LoadLibrary("RbxUtility"))
local player = game.Players.LocalPlayer
local hum = player.Character.Humanoid
local nametag = Instance.new("TextLabel")
nametag.BackgroundTransparency = 1
nametag.BorderSizePixel = 0
nametag.FontSize = "Size18"
nametag.Font = "Arial"
nametag.TextXAlignment = "Left"
nametag.ZIndex = 8
local cont = Instance.new("TextLabel")
cont.BackgroundTransparency = 1
cont.BorderSizePixel = 0
cont.FontSize = "Size18"
cont.Font = "Arial"
cont.TextXAlignment = "Left"
cont.TextColor3 = Color3.new(0.933, 0.933, 0.933)
cont.TextStrokeTransparency = 0.7
cont.Position = UDim2.new(1, 0, 0, 0)
cont.Size = UDim2.new(0, 0, 1, 0)
cont.ZIndex = 8
local cf = script.Parent.ChatFrame
hum.Died:connect(function()
cf.Visible = false
end)
local clr = script:findFirstChild("bnd")
if clr then clr:remove() end
local bndc = nametag:clone()
bndc.Name = "bnd"
bndc.Visible = false
bndc.Parent = script
function getbounds(txt)
bndc.Text = txt
return bndc.TextBounds.x
end
--[[
test = {
{true, "loleris", "I wish I could win"},
{false, "yoyomamaa", "I wish I could die"},
{true, "shedletskyman", "I wish I could dfbzdfbdzfh"},
{false, "gearman", "I wish I could chop chop"},
{false, "noneris", "I wish I could fly"},
{true, "gordonfreehmahn", "I wish I could PINGAS"},
}
--]]
function DrawChat(inf)
cf:ClearAllChildren()
if inf == "" then return end
local list = Utils.DecodeJSON(inf)
for i, v in ipairs(list) do
if v[1] ~= nil then
local ntg = nametag:clone()
ntg.Text = v[2] .. ":"
ntg.Size = UDim2.new(0, getbounds(ntg.Text) + 4, 1/6, 0)
ntg.Position = UDim2.new(0, 0, 1/6 * (i-1), 0)
if v[1] then
ntg.TextColor3 = Color3.new(1, 0, 0)
else
ntg.TextColor3 = Color3.new(0.39, 0.39, 0.39)
end
local nc = cont:clone()
nc.Text = v[3]
nc.Parent = ntg
ntg.Parent = cf
end
end
end
local con = ch.Changed:connect(function() DrawChat(ch.Value) end)
DrawChat(ch.Value)
ing.ChildAdded:connect(function(obj)
if obj.Name == player.Name then
con:disconnect()
cf.Visible = false
end
end)

1 comment
free modelsssssss