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

How to get player.Character when holding a ProximityPrompt?

Asked by 2 years ago
Edited 2 years ago

Hi!

I was wondering if you can use player.Character when holding a ProximityPrompt Or is there an other way to do this?

prompt.PromptButtonHoldBegan:Connect(function(promptObject, player)
    if player.Character:FindFirstChild("Key") then
        sound1:Play()
    else
        print("no key")
    end
 end)

The script will play a sound if you have the keys for the door you have to open. So I need to check if the player has them.

0
Does the script not work or are you just wondering if theres another way to obtain the character? Otherwise just use .Triggered and remove promptObject RazzyPlayz 497 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

try using prompt:InputHoldBegin() instead of prompt.PromptButtonHoldBegan

Ad

Answer this question