I want to Send a message to player though a script. Here's what I tried:

script.Message.OnServerEvent:connect(function(plr, Msg)
	if AdminCheck(plr) == true then
		for i, v in pairs(game:GetService("Players"):GetPlayers()) do
			if v:FindFirstChild("SendMessageToPlr") then
				v.SendMessageToPlr:FireClient(Msg, plr)
			end		
		end
	end
end)

when I play the game, it says this: 19:25:14.639 - Unable to cast value to Object 19:25:14.640 - Stack Begin 19:25:14.642 - Script 'Workspace.PlayerList', Line 301 19:25:14.644 - Stack End why?

2 comments

0

Player argument comes first, then message. ":FireClient(plr,Msg)"

0

Oh Okay I'll try that. Thanks