How to get player from a script

Howdy devs!

How am I going to get the Player’s Character from a script?
because I’m trying to play an Animation when a ProximityPrompt is triggered
image

wh- how do you want to get a player’s character? proximity prompt? click detectors?

game.Players.PlayerAdded:Connect(function(plr)
   local char = plr.Character or plr.CharacterAdded:Wait() -- Char
end)
3 Likes
proximityprompt.Triggered:Connect(function(player)
 local character = player.Character
end)
2 Likes

I guess this could work for now