ProximityPrompt Trigger Code not running after Using a couple ProximityPrompts

  1. What do you want to achieve? Keep it simple and clear!

I would like to achieve my ProximityPrompt Trigger Code to run after another proximity prompt was used.

  1. What is the issue? Include screenshots / videos if possible!

Basically I pick up the screwdriver I need to open the vent cover open the cover use the proximity prompt to open it a few times then enter and exit again but when I try to enter again it doesn’t run the code which runs when it is triggered and other Proximity Prompts don’t work.

I attached a video below.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have looked around in many places but no one really had my same issue.

I haven’t added any scripts as they are quite long but I will send them in replies if they are needed.

2 Likes

Could you show your ventilation script?

1 Like

Alright here is the script that teleports the Player through to the other side.

The Blackout GUI’s didn’t appear in the video but all the client events are just for tweening the GUI.

local ProximityPromptEnter = script.Parent.VentCoverInvis.VentEnter.ProximityPromptEnter
local ProximityPromptExit = script.Parent.VentCoverInvis.VentExit.ProximityPromptExit

local teleport1 = script.Parent.Teleport1
local teleport2 = script.Parent.Teleport2

local blackoutGui = script.Parent.BlackoutGui

local function enter(player)
	ProximityPromptExit.Enabled = false
	ProximityPromptEnter.Enabled = false
	local blackoutGuiClone = blackoutGui:Clone()
	blackoutGuiClone.Parent = player.PlayerGui
	blackoutGuiClone.Enabled = true
	game.ReplicatedStorage.Events.VentBlackout:FireClient(player, 'Open')
	wait(1.4)
	player.Character.HumanoidRootPart.Position = teleport2.Position
	print(player.Name .. " has entered the ventilation system.")
	wait(1)
	game.ReplicatedStorage.Events.VentBlackout:FireClient(player, 'Close')
	wait(1.6)
	blackoutGuiClone:Destroy()
	wait(1)
	ProximityPromptExit.Enabled = true
	ProximityPromptEnter.Enabled = true
end

local function exit(player)
	ProximityPromptExit.Enabled = false
	ProximityPromptEnter.Enabled = false
	local blackoutGuiCloneExit = blackoutGui:Clone()
	blackoutGuiCloneExit.Parent = player.PlayerGui
	blackoutGuiCloneExit.Enabled = true
	game.ReplicatedStorage.Events.VentBlackout:FireClient(player, 'Open')
	wait(1.4)
	player.Character.HumanoidRootPart.Position = teleport1.Position
	print(player.Name .. " has exited the ventilation system.")
	wait(1)
	game.ReplicatedStorage.Events.VentBlackout:FireClient(player, 'Close')
	wait(1.6)
	blackoutGuiCloneExit:Destroy()
	wait(1)
	ProximityPromptExit.Enabled = true
	ProximityPromptEnter.Enabled = true
end

local function ended()
	print("Triggered Ended")
end

ProximityPromptEnter.Triggered:Connect(enter)
ProximityPromptEnter.TriggerEnded:Connect(ended)
ProximityPromptExit.Triggered:Connect(exit)
ProximityPromptExit.TriggerEnded:Connect(ended)

Try adding more print() functions inside your enter and exit function instead of just using your ended() function.

1 Like

I added some more print() functions but when I enter the first time it works I then waited 15 seconds before exiting that worked but after a further 15 seconds I tried to enter this time it didn’t work and no other prompts in the area seemed to work either.

So it seems that the .Triggered event suddenly doesn’t run when you retry the PromixityPrompt the second time…

Could you screenshot the properties of PromixityPromptExit and PromixityPromptEnter?

This one is for the enter Prompt:

And this one is for the exit Prompt:

They are enabled by the script that unscrews the vent cover.

This is what I want you to do.

Inside the local function ended(), print out the value of ProximityPromptExit.Enabled and ProximityPromptExit.Disabled.

Even though .Triggered doesn’t seem to run, .TriggerEnded does apparently.

I just printed The exit prompt’s Enabled property and it printed true so It seems to be enabled.

1 Like

Alright, have you tried publishing the game and trying to play it in-game? (Not in Roblox Studio)

Just tried that after unscrewing the cover Entering worked but as before exiting didn’t neither did other prompts but resetting and using admin commands to get to the side you would exit from it did allow me to exit and enter again but after a few times it Stopped letting me enter.

Thanks for your help so far but what seems to be the issue is the game I’m working on is set to R6 so that seems to be stopping the prompts from working as they worked when I changed it to R15 and I need the game to be R6 any idea on how to make it work with R6?