local DistanceCheck = GlobalFunctions["DistanceCheck"](Character, 60) if DistanceCheck ~= false then local PlrsInDistance = Players:GetPlayerFromCharacter(DistanceCheck) Remote:FireClient(PlrsInDistance, Character, Hit) end
DistanceCheck:
for _,v in pairs(workspace:GetChildren()) do if v ~= Character and v:FindFirstChild("HumanoidRootPart") and (Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude <= Range then local plrindistance = game.Players:FindFirstChild(v) return plrindistance end end
Error: 12:39:04.987 - FireClient: player argument must be a Player object
I'm trying to make it so if only player's are in a 60stud range it will fireclient for effects. But i'm having trouble. Could someone help me out?
On the distance check script, I think your error is on line 4. Instead of using
local plrindistance = game.Players:FindFirstChild(v)
, Try using
local plrindistance = game.Players:FindFirstChild(v.Name)
instead.