Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a part with player detector?

I Mean to like, creating a part and then if anyone has touched it I'm will be announcement like, "(Name of player) Has touched the part", I'm need this beacuse im wanna know who comes in... Please anyone help

1 comment

0

Read community guidelines

1 answer

✓ Accepted answer

Welp, I'll be willing to help with that.

Have a part in Workspace named "namecaller", then create a LocalScript in StarterGui like this:

local player = game.Players.LocalPlayer

while game.Workspace:FindFirstChild(player.Name) == nil do
	wait()
end

wait(1)

player.Character.Humanoid.Touched:connect(function(part, part2)
	
	if part.Name == "namecaller" then 
		print(part2.Parent.Name)
	end	
end)

It should work given that the name of the part doesn't have any spaces, capitalization, etc.

This discussion is preserved as it was. New answers, comments, and votes are closed.