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

can i take one players who touch a part with ( for _, player in pairs) ?

Asked by 6 years ago
Edited 6 years ago
Part.Touched:connect(function()
    for _, player in pairs(game.Players.) --?? what i can add make just select the player who touch the part 
    print("This player touch this part !!")
    end
end)

1 answer

Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
6 years ago
Part.Touched:connect(function(hit)
    if game.Players:FindFirstChild(hit.Parent.Name) then 
        playerName = hit.Parent.Name
        print(playerName .." has touched this part !!")
    end
Ad

Answer this question