So I am trying to make a Server System Message, but right now, it only sends to the client, could you please review my code and say what's wrong with it, and what I need to change? LocalScript in StarterPlayerScripts:
Player = game.Players.LocalPlayer
Character = Player.CharacterAdded:Wait()
Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
game.ReplicatedStorage.YourEvent:FireServer()
end)
game.ReplicatedStorage.YourEvent2.OnClientEvent:Connect(function(DiedPlayer)--[[Your Event is a placeholder, just incase it wasnt clear.]]
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = DiedPlayer.." has died!",
Color = Color3.fromRGB(255,0,0),
Font = Enum.Font.SourceSansBold
})
end)
Server Script in SSS(ServerScriptService):
game.ReplicatedStorage.YourEvent.OnServerEvent:Connect(function(plr)
local DiedPlayer = plr.Name
game.ReplicatedStorage.YourEvent2:FireAllClients(DiedPlayer)--Same Here.
end)
The problem is, it does work for every player, but only works once. It says that a player has died when they died only once, and when they die again, the message doesn't popup. Any help? Thanks! :D I eventually got help, now it's working fine! Thanks to all who tried!
