System Message Caps

Hello, I made a system message, that can be sent by a player.
I wanna make it message with caps unless player typed without caps.

Source:

local event = game:GetService("ReplicatedStorage").RemoteEvents:WaitForChild("SendWarn")

function MakeMSG(plr, text)
	local color = BrickColor.new("Really red")
	
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = "["..plr.Name.."]: "..text;
	Font = Enum.Font.SourceSansBold;
	Color = color.Color;
	FontSize = Enum.FontSize.Size96
	
})
end

event.OnClientEvent:Connect(function(plr, text)
	MakeMSG(plr, text)
end)

Hello there! Can you please elaborate on what you mean by “Unless player typed without caps” so we can help you? Thanks.

1 Like

Is like, if player types “hi” in chat it shows like “HI”

You may be looking for string.upper(). Say you use the script:

print(string.upper("hello world!"))

It would output:

HELLO WORLD!

In your case, you can change line 7 of your script from

Text = "["..plr.Name.."]: "..text;

to

Text = "["..plr.Name.."]: "..string.upper(text);

Best regards!

2 Likes

Thanks so much. :grinning:
Is string.lower is the same but it makes text non-caps?

Absolutely!

Just as an example, if you use

print(string.lower("HELLO WORLD!"))

It would output:

hello world!

Glad I could help!

1 Like

Thanks for explanation. :smile:

1 Like