Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to get player.Character when holding a ProximityPrompt?

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.

1 comment

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

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.