Here is my Server Script
local Allowed = {'CRAZYQUACKY84'}
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local RemoteManager = ReplicatedStorage:WaitForChild('RemoteManager')
local WarnManager = RemoteManager:WaitForChild('WarningManager')
game.Players.PlayerAdded:Connect(function(plr)
for _,a in pairs(Allowed) do
if plr.Name == a then
plr.Chatted:Connect(function(warncmnd)
if string.sub(warncmnd, 1, 5) == ':warn' then
local plrToWarn = game.Players:FindFirstChild(string.sub(warncmnd, 7))
if plrToWarn then
WarnManager:FireClient('You have been given a warning by: '..plr.Name..'\n Reason: Violating Terms of Service, if commited again will lead to a kick')
end
end
end)
end
end
end)
Here is my local script in the UI.
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local RemoteManager = ReplicatedStorage:WaitForChild('RemoteManager')
local WarnManager = RemoteManager:WaitForChild('WarningManager')
WarnManager.OnClientEvent:Connect(function(msg)
wait(1)
script.Parent.WarningTitle.Text = msg
wait(3)
script.Parent.WarningTitle.Text = ''
end)
I am trying to get it to write a command to send a UI message to a specific player.

1 comment
Thanks bro!