ProximityPrompt not triggering/script not working

Hey, I am trying to make it so a proximityprompt triggers and fires a remoteEvent. However, nothing prints and nothing happens when I trigger the prompt.
This is in a localscript by the way, in a part which a proximityprompt is in aswell.

My code:

local part = script.Parent
local replicatedStorage = game:GetService("ReplicatedStorage")
local pickupEvent = replicatedStorage.CollectedFurniture
local proxPrompt = part.ProximityPrompt


local starterGui = game:GetService("StarterGui")
local gui = starterGui.CurrencyGUI
local furnitureframe = gui.FurnitureHolder.FurnitureFrame
local amount = furnitureframe.Amount
local Backpack = gui.LocalScript


script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
	print("Fired!")

	if plr then

		print("Fired2")
		pickupEvent:FireServer()

	end
end)

This may be a simple fix, but as you know I am a bad scripter. Thanks for any help!!

1 Like

The error is because of where the Local Script. Local Scripts do not function unless they’re in a StarterPlayerScript and a few other specific places.

Edit: Also from what it seems, you don’t seem to actually need to use a remoteEvent for this

So I tried the code you provided myself, and it does work. Just switch from a LocalScript to a Script and set the RunContext to Client.


Yes, but theres another part. I want it to make a gui add +1 to a inventory backpack, I don’t know if you are supposed to use remoteevents though…

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