Hi, I’m trying to get the player’s character so I can check for some factors. However, I can’t seem to get the player’s character despite the argument being valid; in which plr contains the player’s name (mine in this context). What is the issue?
ServerScript:
local function Checker(plr)
.
.
.
if plr then
local player = game.Players:FindFirstChild(tostring(plr))
local character = player:WaitForChild("Character") -- Infinite yield possible on 'Players.tz_ow:WaitForChild("Character")'
if character then
if character:FindFirstChild("Tray") then
Count = Count + #character:FindFirstChild("Tray").Foods:GetChildren()
else
end
end
end
ServerScript2:
.
.
.
RunService.Heartbeat:Connect(function()
task.wait(PetStats.pickupspeed)
local value = CheckIfAvailable:Invoke(Player)
.
.
.