Hey, I have a problem where I’m trying to make a message appear whenever somebody gets banned, but the message just doesn’t fire.
Local Script inside Starter Gui
local function serverMessage(content)
game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = "[AAC] "..content,Color3.fromHSV(0.992, 0.815686, 1),Font = Enum.Font.SourceSansLight})
end
game:GetService("ReplicatedStorage").AACEVENTS.servermsg.OnClientEvent:Connect(function(msg)
serverMessage(msg)
end)
Server Script
local dds = game:GetService("DataStoreService")
local banData = dds:GetDataStore(game.CreatorId.."dqhdaiaqSkdsqjqn".."_aac")
game.Players.PlayerAdded:Connect(function(plr)
wait(plr:WaitForChild("AAC"):WaitForChild("Warnings").Value)
if banData:GetAsync(plr.UserId,true) then
plr:Kick("Server Connection Failed - Error Msg: The user ID "..plr.UserId.." is banned from connecting to the server")
else
plr.Chatted:Connect(function(msg)
if msg == ";" then
if plr.AAC.Warnings.Value == 3 then
banData:SetAsync(plr.UserId,true)
plr:Kick("Session forcefully ended")
game:GetService("ReplicatedStorage").AACEVENTS.servermsg:FireAllClients(plr.Name.." has been permanently banned for exploiting.")
else
plr.AAC.Warnings.Value = plr.AAC.Warnings.Value + 1
plr:Kick("Disconnected from server: the usage of ';' is banned")
end
end
end)
end
end)
That makes no sense. The second bracket is supposely the “end”'s bracket if you are experienced with roblox studio. Your basically adding a extra bracket to a end function.
You forgot “Color”. You instead just use Color3.fromHSV
Fix :
local function serverMessage(content)
game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = "[AAC] "..content,Color = Color3.fromHSV(0.992, 0.815686, 1),Font = Enum.Font.SourceSansLight})
end