basically I'm trying to fire an event. Here's the script (Server Script btw):

Ray Section:

local Players = game:GetService("Players")

for i,v in pairs(game.Workspace:GetChildren()) do
		local human = v:FindFirstChild("Humanoid")
		local head = v:FindFirstChild("Head")
		
		if human and head then
			if (Camera.Position - head.Position).magnitude < 40 then
				local HRay = Ray.new(Camera.Position, (head.Position - Camera.Position))
				local Hit, HVector = workspace:FindPartOnRayWithIgnoreList(HRay, ignorelist)
				local playerhead = workspace:FindPartOnRayWithWhitelist(HRay, {head})
				local RayH = (Camera.Position - HVector).unit

Event Section:

Hiding:FireClient(Players:GetPlayerFromCharacter(playerhead.Parent))

When I run this it say player argument must be a player object on the event part. Can someone help please? Thanks.

2 comments

0

What error is the line on??

0

its on the line where the event is fired (Hiding:FireClient(Players:GetPlayerFromCharacter(playerhead.Parent)))