Proximity Prompt isn't triggering

Hello! So I’ve been working on a game, and there is this part where the player has to interact with a button. The button uses a Proximity Prompt, and I programmed it so that when the player presses it, the Proximity Prompt will disable and an IntValue in the Replicated Storage will go up by 1.

It was supposed to do this, however, every time I interact with the Proximity Prompt, nothing happens. Also, it’s really weird because there is no error in the output telling me if something went wrong with the script.

I’ve tried doing simple debugging like making Prints throughout the script to see where the script stops. The script makes it through the Variable Part, however, the script just seems to stop when reaching the ProximityPrompt Trigger part. The Script is located in the Workspace, and its parent is the ProximityPrompt.

Here is the Script:

local DBButtonClicks = game:GetService("ReplicatedStorage"):WaitForChild("DBButtonClicks")

script.Parent.Triggered:Connect(function()
	script.Parent.Enabled = false
	DBButtonClicks.Value += 1
end)

Any help?

1 Like

Just tried it,
Print(DBButtonclicks.value) to see what the number is in the output.
it works correctly (also make sure its a script not a local script, unless you just want the number to increase for the player)
it works fine for me.
heres what i added

local DBButtonClicks = game:GetService("ReplicatedStorage"):WaitForChild("Value") -- my value

script.Parent.Triggered:Connect(function()
	script.Parent.Enabled = false
	DBButtonClicks.Value += 1
	print(DBButtonClicks.Value) 
end)



Hey! Thanks for your reply. That’s so weird, I just plugged in your script and it still didn’t work.

It didn’t give me any error in the output, and I am using a regular Script.

Can I ask to see the scripts you have in your game? That might affect the prompt?

Sure thing.

Button ProximityPrompt

(The Disabled Script is the original script. I made a new script to plug in the one you made.)

Hmm.
I know this sounds dumb but copy it and paste it into a new test game.
sometimes this works LMKif it works

Wow. Thats weird. It does work in a different game. Do you know why?

no not really but it might be another script in your game messing with it

Okay, thanks a lot. I’m pretty sure the scripts were not loading in because of lag in my game. I’m not sure exactly what was causing the problem though.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.