it doesn’t error but doesn’t work either…
I drew over the lines that don’t matter
try
if touchedpart.Parent.Name == desiredshelf.Name then
--touchedpart.Parent.Name is the name of the player that touced the part
end
Doesn’t work still and why would i wanna know the name of the parent?
touchedpart is the part that touched the part
touchedpart.Parent is the player’s character
touchedpart.Parent.Name is the player’s name
I assume you used touchedpart.Name because you were trying to find the player
Also try using print() it could sometimes help you
print(touchedpart)
print(touchedpart.Parent)
print(desiredshelf.Name)
No im trying to find a shelf so you can stock it in a supermarket
Then the if statement comparing
--touchedpart and desireshelf
wouldn’t match because touchpart would be a body part and desireshelf is the name of a shelf.
just erase the if statement if you can’t find a alternative