local function moveTo(player, part)
wait()
local forest = part
local x = forest.Position.X + math.random(-forest.Size.X/2,forest.Size.X/2)
local y = forest.Position.Y + math.random(-forest.Size.Y/2,forest.Size.Y/2)
local z = forest.Position.Z + math.random(-forest.Size.Z/2,forest.Size.Z/2)
local hum = player:WaitForChild("Humanoid")
if hum then
player.Character:SetPrimaryPartCFrame(CFrame.new(x,y,z) + Vector3.new(0,5,0))
end
end
for some reason, im getting the error code Character is not a valid member of Model "Workspace.Player2". im pretty sure its because its checking before the player loads in, but i dont know how to implement it