ProximityPrompt trigger not working

I have a script that moves the player to a specific part when a ProximityPrompt is triggered. One of the ProximityPrompts functions, but the other does not. This issue occurs only with the server script, whereas in a local script, both ProximityPrompts work. When I try printing, one doesn’t work while the other works fine. here is the server script:

-- this one works --
script.Parent.Enter.ProximityPrompt.Triggered:Connect(function(plr)
	plr.Character.HumanoidRootPart.Position = script.Parent.Start.Position + Vector3.new(0,2,0)
	if script.Parent.Reset.Value == true then
		script.Parent.Reset.Value = false
	else
		script.Parent.Reset.Value = true
	end
end)

-- this one dose not --
script.Parent.Door.ProximityPrompt.Triggered:Connect(function(plr)
	print(plr.Name)
	plr.Character.HumanoidRootPart.Position = script.Parent.Exit.Position + Vector3.new(0,2,0)
end)

Here’s the local script:

script.Parent:WaitForChild("Enter").ProximityPrompt.Triggered:Connect(function()
	game.Workspace.Inputs["No Sky"].Value = true
end)

script.Parent:WaitForChild("Door").ProximityPrompt.Triggered:Connect(function()
	game.Workspace.Inputs["No Sky"].Value = false
end)

There’s no other scripts that interact with the prompts.

Does it prints any error messages?, try checking the proximity prompt properties, like enabled, or something like that

1 Like

Are you 100% sure this is the correct location of the prompt?

Is the Prompt E icon is showing?

Is the Door the prompt is in a BasePart, Attachment, or a Model with a Primary Part set as per the link I included?

There are no error messages, and everything is configured properly.

The “Door” is a part, the E icon is showing, and its the correct location.

is the player name printing when triggered?

Nope. There’s absolutely nothing in the output.

Is the door already there when the game starts? in the local script you used waitforchild, maybe you can try using it in server script, If this doesnt work please give more context about the issue

Yes. the door’s there from the start. Just tried waitforchild and dose not work. This is how everything is set:

Are you sure both proximity prompts are shown?

Are “Enter” and “Door” close to eachother? If so, are the “Enter” and “Door” prompts assigned to the same keybind? Because if yes, one will take precedence over the other

They are quite distant. they Can’t be shown at once.

Can you show the door proximity promt properties?

Certainly! Here you go:

is the server script you shared the full script?

This is the full script:

-- this one works --
script.Parent:WaitForChild("Enter").ProximityPrompt.Triggered:Connect(function(plr)
	plr.Character.HumanoidRootPart.Position = script.Parent.Start.Position + Vector3.new(0,2,0)
	if script.Parent.Reset.Value == true then
		script.Parent.Reset.Value = false
	else
		script.Parent.Reset.Value = true
	end
end)

-- this one dose not --
script.Parent:WaitForChild("Door").ProximityPrompt.Triggered:Connect(function(plr)
	print(plr.Name)
	plr.Character.HumanoidRootPart.Position = script.Parent.Exit.Position + Vector3.new(0,2,0)
end)

script.Parent.Reset.Changed:Connect(function()
	
	for _, part in ipairs(script.Parent["Current Rooms"]:GetChildren()) do
		part:Destroy()
	end
	
	for _, part in ipairs(script.Parent.Checks:GetChildren()) do
		part:Destroy()
	end
	
	script.Parent.Rooms.Value = 0
	
	local hall = game.ReplicatedStorage.Dungeon.Hallway:Clone()

	hall:SetPrimaryPartCFrame(script.Parent.Start.CFrame)
	hall.Parent = game.Workspace["New Dungeon"]["Current Rooms"]

	script.Parent.Rooms.Value += 1
	
end)

Can you show where you create your ProximityPrompts in code, not just connecting the functions to them

I’m not creating them through a script; I’ve simply placed them there. I’ve shown everything about those two prompts there is. However, I believe I could generate the prompts through scripts and configure them.

Back to basics then. Try this:

-- this one dose not --
print(script.Parent:WaitForChild("Door").Name)  -- checking if Door is found to see if triggered can connect.
script.Parent:WaitForChild("Door").ProximityPrompt.Triggered:Connect(function(plr)

Its found. Also I just tried to run it in a new script that contains only this:

-- this one dose not --
script.Parent:WaitForChild("Door").ProximityPrompt.Triggered:Connect(function(plr)
	print(plr.Name)
	plr.Character.HumanoidRootPart.Position = script.Parent.Exit.Position + Vector3.new(0,2,0)
end)

but still no trigger event.

Also tried to change the “RunContext” to server and still no change.

Just tried doing it like this:

-- this one dose not --
local prox = Instance.new("ProximityPrompt")
prox.Parent = script.Parent.Door
prox.MaxActivationDistance = 6
prox.ActionText = "Exit"
prox.ObjectText = "Door"
prox.Triggered:Connect(function(plr)
	print(plr.Name)
	plr.Character.HumanoidRootPart.Position = script.Parent.Exit.Position + Vector3.new(0,2,0)
end)

Still no trigger tho.