Does anyone know how to get around the error FireClient: player argument must be a player object.
Ive trying to make sense of the roblox Developer Website RemoteEvent | Documentation - Roblox Creator Hub but there is no thing on there about the error “FireClient: player argument must be a player object”. In fact, really ive been searching google and either someone got around the problem BUT didn’t post the solution, or nobody knows about it. Here is the script, I am using a RemoteEvent.
— listener
local Dummy1 = game.Workspace.Dummy1
local player = game:GetService(“Players”)
local VPlayer = player.LocalPlayer
You’re passing Players.LocalPlayer to the first argument of FireClient.
If this is a LocalScript:
You’re looking for :FireServer, and you can remove the player argument.
If this is a Script/ServerScript:
You cant access Players.LocalPlayer from the server, it only works on the client, you’d need the Player instance to be passed to FireClient.
Seeing the console error, this is a server error. You cannot access LocalPlayer on the server, hence this is set to nil when attempting to fire the remote for the player.
You would have to do
Remote:FireClient(player["PlayerName"]) --gets the player object based on the defined player name
However, since there is limited information provided, I cannot provide any further suggestions. Can you please provide more context about what you’re trying to accomplish here?