Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a part with player detector? [closed]

Asked by 6 years ago

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

0
Read community guidelines RAYAN1565 691 — 6y

Closed as Not Constructive by RAYAN1565, Vulkarin, and User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by 6 years ago

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.

Ad