FireClient: player argument must be a Player object!

Hi i need help with my script that gives me this error: "FireClient: player argument must be a Player object "

local module = {}

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Players = game:GetService("Players")

local Remotes = ReplicatedStorage:WaitForChild("RemoteEvents")

local Player = Players.LocalPlayer

function module.OnAttach(Drop, Hammer, Damage)

Remotes:WaitForChild("DamageDrops"):FireClient(Player, Drop.Parent, Damage)

Hammer.Parent.CanDamage.Value = false

wait(1)

Hammer.Parent.CanDamage.Value = true

end

return module

Is this client or server? I ask because LocalPlayer is available only on the client while FireClient() is only available on the server. Did you mean FireServer?

Its a module script, i dont know why its not working

You cannot trigger LocalPlayer from the server, because FireClient is only effective on the server, but LocalPlayer is a local way to determine the player.

Find a way to detect the player from the server to communicate with the client.

You can just pass the player as an argument in the module.OnAttach function.

1 Like