Why does this script always print "nil" instead of the body parts?
im trying to make a thing like when u click a part it scans the players which r touching the part, i wanted to test out GetTouchingParts() so i made it so whatever items are touching the part, it prints their name. when i go inside the part and click scan, it just prints nil 4 times here is the script
01 | local clickdetector = script.Parent.ClickDetector |
02 | local scanpart = game.Workspace.SCANPART |
05 | script.Parent.ClickDetector.MouseClick:Connect( function () |
07 | touchingparts = scanpart:GetTouchingParts() |
08 | print (touchingparts [ 1 ] ) |
09 | print (touchingparts [ 2 ] ) |
10 | print (touchingparts [ 3 ] ) |
11 | print (touchingparts [ 4 ] ) |