Why Wont The Chat Script Below Display The Chats? There Were No Errors.
Chatcount = 0
Maxchats = 10
CanvasSizea = 1
Focused = false
game:GetService('UserInputService').InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.Slash then
if Focused ~= true then
script.Parent.ChatBar:CaptureFocus()
Focused = true
repeat
wait(.1)
script.Parent.ChatBar.Text = ""
until script.Parent.ChatBar.Text == ""
end
end
end)
script.Parent.ChatBar.FocusLost:connect(function(enter)
if enter == true then
Focused = false
local Msg = script.Parent.ChatBar.Text
print(Msg)
game:GetService('ReplicatedStorage').ChatFunctions.FilterChat:InvokeServer(game:GetService('Players').LocalPlayer, Msg)
script.Parent.ChatBar.Text = ""
end
end)
game:GetService('ReplicatedStorage').ChatFunctions.PublicChat.OnInvoke = function(plr, msg)
if Chatcount == 0 then
msgclone = game:GetService('ReplicatedStorage').ChatMsg:Clone()
msgclone.Parent = script.Parent.ChatWindow.ScrollingFrame
Chatcount = Chatcount + 0.08
if plr == "TheGrimDeathZombie" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Founder]"..msg
elseif plr == "SamgladiatorRB" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Youtuber]"..msg
elseif plr == "DrKaiBlox123" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Co-Founder]"..msg
elseif plr == "Player1" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Founder]"..msg
end
else
msgclone = game:GetService('ReplicatedStorage').ChatMsg:Clone()
msgclone.Parent = script.Parent.ChatWindow.ScrollingFrame
msgclone.Position = UDim2.new(0, 0, Chatcount, 0)
wait(.1)
Chatcount = Chatcount + 0.08
if plr == "TheGrimDeathZombie" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Founder]"..msg
elseif plr == "SamgladiatorRB" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Youtuber]"..msg
elseif plr == "DrKaiBlox123" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Co-Founder]"..msg
elseif plr == "Player1" then
local rainbow = game:GetService('ReplicatedStorage').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Founder]"..msg
end
end
if Chatcount >= Maxchats then
Maxchats = Maxchats + 1
CanvasSizea = CanvasSizea + 1
script.Parent.ChatWindow.ScrollingFrame.CanvasSize = UDim2.new(0, 0, CanvasSizea, 0)
end
end
