Proximity prompt

how would I make this proximity prompt instead of a click detector

function onClicked()
	script.Parent.PullDownScript.Disabled = true
	script.Parent.ClickDetector.MaxActivationDistance=0
	script.Parent.Close.Disabled = false
	script.Parent.Open.Disabled = true
	wait(0.8)
	script.Parent.Orig.Bang:Play()
	wait(0.8)
	script.Parent.Close.Disabled = true
	script.Parent.PullDownScript.Disabled = false
	script.Disabled = true
	script.Parent.ClickDetector.MaxActivationDistance=52
end
	script.Parent.ClickDetector.MouseClick:connect(onClicked)


2 Likes
1 Like

I’m sorry, I’d like to help but it would be easier if I knew what you are trying to do. Could I have some more specifics on what you want to be happening?

1 Like

He has a script that fires the function when the clickdetector has been clicked and he wants to know how he can do the same with a ProximityPrompt which is why I have replied with two links explaining all the information needed on ProximityPrompts.

1 Like

This should do it

function onClicked()
	script.Parent.PullDownScript.Disabled = true
	script.Parent.ClickDetector.MaxActivationDistance=0
	script.Parent.Close.Disabled = false
	script.Parent.Open.Disabled = true
	wait(0.8)
	script.Parent.Orig.Bang:Play()
	wait(0.8)
	script.Parent.Close.Disabled = true
	script.Parent.PullDownScript.Disabled = false
	script.Disabled = true
	script.Parent.ClickDetector.MaxActivationDistance=52
end
	script.Parent.[Name of Prompt].MouseClick:connect(onClicked) --Removed MouseClick, added Triggered.
1 Like