Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont the death message change?

Asked by
CjayPlyz 643 Moderation Voter
4 years ago

Script

local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local Players = game:GetService("Players")
local DeathMessages = {
    " forgot how to jump.",
    " tried to swim in air.",
    " jumped into nothing.",
    }

local function PlayerAdded (Player)
    Player.CharacterAdded:Wait()
    Player.Character.Humanoid.Died:Connect(function()
        RemoteEvent:FireAllClients({
            Text = "[Server]: "..Player.Name..DeathMessages[math.random(1,3)],
            Color = Color3.fromRGB(255,0,0)
        })
    end)
end

Players.PlayerAdded:Connect(PlayerAdded)

Local Script

local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

local function OnClientEvent (chatProperties)
    game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",chatProperties)
end

RemoteEvent.OnClientEvent:Connect(OnClientEvent)

I'm only new to this SetCore stuff so I don't really know what I'm doing. The problem is that the message won't change.

Answer this question