Hello! I’m a bit stuck on how to even convert this local script into a server script, I want the system notifications in the chat to be visible to everyone in the game.
Location:
(OofHandler)
Script:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
bc = BrickColor.new(255,0,0)
humanoid.Died:Connect(function()
print("{SYSTEM}: "..game.Players.LocalPlayer.Name.." has been banned.")
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "{SYSTEM}: "..game.Players.LocalPlayer.Name.." has been banned.";
--Font = Enum.Font.SourceSans;
Color = bc.Color;
FontSize = Enum.FontSize.Size60;
})
end)
-- script
bc = BrickColor.new(255,0,0)
game.Players.PlayerAdded:Connect(function(player)--every player that joins is registered
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid .Died:Connect(function()
game.ReplicatedStorage.RemoteEvent:FireAllClients(player) -- since we cant use setCore on a server script i use a RemoteEvent
end)
end)
--local script
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(OtherPlayer)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "{SYSTEM}: "..OtherPlayer.Name.." has been banned.";
--Font = Enum.Font.SourceSans;
Color = bc.Color;
FontSize = Enum.FontSize.Size60;
})
end)