Ok, so what I did was when a player joins then I put in my variables and then make it so a robot gets cloned and spawns near them, but when I run it, I get "03:25:55.643 - Infinite yield possible on 'Players.lilzy7:WaitForChild("Character")' " and then my code deactivates (does not clone the robot when I hit Play test button and wait) and doesn't print anything
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local plr = player:WaitForChild("Character")
local humroot = plr:WaitForChild("HumanoidRootPart")
wait(2)
print("yay")
local robot = game.ServerStorage["Robot Follower"]:Clone()
robot.HumanoidRootPart.Position = humroot.Position + Vector3.new(math.random(-50,50),0,math.random(-50,50))
robot.Parent = game.Workspace
print("yay")
end)
(the robot is a dummy)
Please help and thank you!!!

1 comment
Thank you!