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

How to get player from triggering proximity prompt?

Asked by 2 years ago

I don't want to get the player name. I want to get like the player model [from workspace] (humanoid, body parts and stuff). How do I do that?

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

the model with the humanoid would be their character.

local proximityprompt = script.Parent -- may need to edit this depending on the location of your script
proximityprompt.Triggered:Connect(function(player) -- gives player object, not their name
    assert(player.Character, "character is missing")
    local character = player.Character -- this would be what you're looking for
end)

you can use this if you're stuck on something

https://developer.roblox.com/en-us/api-reference/class/ProximityPrompt

0
Learn how to make clickable links, for example; `[Google!](https://google.com)` Antelear 185 — 2y
Ad

Answer this question