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

getting player from proximity prompt?

Asked by 3 years ago

how would you get the name of the player who triggered the proximity prompt

1 answer

Log in to vote
4
Answered by
appxritixn 2235 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

Taken directly from the ProximityPrompt API page:

workspace.Part.ProximityPrompt.Triggered:Connect(function(player)
    print("The user interacted with me!")
end)

For more information on the Triggered event, visit this link

To get the name of the player, use:

player.Name
0
Ayo don't act all smug taken directly from proximity prompt api page i alr used that script i asked how to get the player who triggered it cookiethesoda 0 — 3y
0
@cookiethesoda What do mean exacly? MarkedTomato 810 — 3y
0
@cookiethesoda The player object? MarkedTomato 810 — 3y
1
The player object (the player who triggered it) is given from the event. The player object from the 'Triggered' event is the only argument in the function. appxritixn 2235 — 3y
Ad

Answer this question