Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a script that sends a personal message to specified players?

local msg = Instance.new('Message', workspace)
	
if game.Players.LocalPlayer.Name ==("Nath390Fish" and "VinnyDBlaz") then
	msg.Parent = game.Players.LocalPlayer.Name
	 msg.Text = "Personal message Test"
	wait(5)
		msg:Remove()
end

Using the Message instance, I want the game to send a message to players listed only when they join.

1 answer

Here you go. You can also use tables to make a whitelist.

local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")

local Message = Instance.new("Message")
Message.Text = ("Personal Message Test");

local Users = {
	("Nath390Fish");
	("VinnyDBlaz");	
};

for _,Username in pairs(Users) do
	if Players.LocalPlayer.Name == Username then
		Message.Parent = Workspace
	end
end
coroutine.wrap(function()
	wait(5)
	Message:Destroy()
end)()

This discussion is preserved as it was. New answers, comments, and votes are closed.