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

Script not sending out messages in chat?

Asked by
CodeWon 181
3 years ago
-->>: System messages

function makeSystemMessage(text, font, color)
    game.StarterGui:SetCore("ChatMakeSystemMessage", { -- Creates message
        Text = text;
        Font = font;
        Color = Color3.new(color)
    })
end

while wait(40) do
    makeSystemMessage("Having fun? Leaving a like on the game would be appreciated!", Enum.Font.Arial, "Cyan")
end

-- Sends a message when a player joins
game.Players.PlayerAdded:Connect(function(player)
    makeSystemMessage(player.Name.." has joined the game!", Enum.Font.Arial, "Deep Orange")
end)

-- Sends a message when a player leaves
game.Players.PlayerRemoving:Connect(function(player)
    makeSystemMessage(player.Name.." has left the game!", Enum.Font.Arial, "Deep Orange")
end)

This script is supposed to say things in chat when a player joins and leaves and such. But it doesn't work. This is a local script as well, I also tried it in a script and it didn't work-It told me to use a local script basically. The local script doesn't work though, whats wrong?

1 answer

Log in to vote
0
Answered by 3 years ago

I believe you need to use BrickColor for this and not Color3.new

game.StarterGui:SetCore("ChatMakeSystemMessage", { -- Creates message
        Text = text;
        Font = font;
        BrickColor = BrickColor.color 
    })

if you want to use color3.new then

makeSystemMessage("Having fun? Leaving a like on the game would be appreciated!", Enum.Font.Arial,(0.0156863, 0.686275, 0.92549)) --this is the color3 value for cyan
end

recommended to use brickcolor or Color3.fromRGB instead.

0
Brick Color doesn't work, and when I try to put in an RGB value for Color3.fromRGB, the comma and parenthethesis get underlined red CodeWon 181 — 3y
Ad

Answer this question