game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Wait() --add this
if Player:DistanceFromCharacter(script.Parent.Position) >= 10 then
-- do stuff
end
end)
this probably lags but its probably what youre looking for
game:GetService("RunService").Heartbeat:Connect(function()
for i,v in ipairs(game.Workspace:GetPartBoundsInRadius(script.Parent.Position,10)) do
if game.Players:GetPlayerFromCharacter(v.Parent) then
print("hi") --do thing
end
end
end)