This is what I mean, http://wiki.roblox.com/index.php?title=Libraries_and_Samples/ImageInputLibrary
And Heres my Code, I feel like this could structured in a better way.
function GetPlayer(Position)
local Child = workspace:GetChildren()
local Distance = 10
for i=1 , #Child do
if Child[i].ClassName == "Model" then
local Humanoid = Child[i]:FindFirstChild("Humanoid")
if Humanoid ~= nil then
local CheckTorso = Child[i]:FindFirstChild("Torso")
if CheckTorso ~= nil then
if (CheckTorso.Position - Position).Magnitude < Distance then
SayHi()
end
end
end
end
end
end
function SayHi()
print("Hi")
wait(5)
end
game:GetService("RunService").RenderStepped:connect(function()
GetPlayer(script.Parent.Position)
end)
