Proximity Prompt not appearing after using it once

I’m trying to have a proximity prompt that allows me to enter a car. It works, however after using the prompt once, it stops showing up.

Video Example:

I have searched all over the forum but nobody has had the same issue as me.
Vehicle seat code:

local player
local char
local Scripts = script.Parent.Parent.Scripts
local ContextActionService = game:GetService("ContextActionService")
local EXIT_ACTION_NAME = "VehicleChassisExitVehicle"
script.Parent.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" then
		
		player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
		char = workspace:WaitForChild(player.Name)
		char:WaitForChild("Humanoid").HeadScale.Value = 0.1

		char:WaitForChild("Humanoid").BodyDepthScale.Value = 0.1

		char:WaitForChild("Humanoid").BodyWidthScale.Value = 0.1

		char:WaitForChild("Humanoid").BodyHeightScale.Value = 0.1
		local playerGui = player:WaitForChild("PlayerGui")
		
		local screenGui = Instance.new("ScreenGui")
		screenGui.Name = "_ClientControls"
		screenGui.ResetOnSpawn = true
		screenGui.Parent = playerGui
		
		local scriptsReference = Instance.new("ObjectValue")
		scriptsReference.Name = "ScriptsReference"
		scriptsReference.Value = Scripts
		scriptsReference.Parent = playerGui
		
		local clone2 = script.Parent.Parent.Scripts.LocalVehicleGui:Clone()
		clone2.Parent = player.PlayerGui
		
		local clone = script.Parent.Parent.Scripts.Driver:Clone()
		clone.Disabled = false
		clone.Parent = player.PlayerGui
		player.CameraMaxZoomDistance = 35
		player.CameraMinZoomDistance = 0.5
		clone.CarValue.Value = script.Parent.Parent	
		script.Parent.EnterDrive.ProximityPrompt.MaxActivationDistance = 0
	end
end)

script.Parent.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then
		char:WaitForChild("Humanoid").HeadScale.Value = 1

		char:WaitForChild("Humanoid").BodyDepthScale.Value = 1

		char:WaitForChild("Humanoid").BodyWidthScale.Value = 1

		char:WaitForChild("Humanoid").BodyHeightScale.Value = 1 
		if player.PlayerGui:FindFirstChild("Driver") then
			player.PlayerGui.Driver:Destroy()
		end
		if player.PlayerGui:FindFirstChild("LocalVehicleGui") then
			player.PlayerGui.LocalVehicleGui:Destroy()
		end
		player.CameraMaxZoomDistance = 400
		player.CameraMinZoomDistance = 0.5
		game.ReplicatedStorage.unbindCarKeys:FireClient(player)
		wait(0.001)
		char:SetPrimaryPartCFrame(script.Part.CFrame)
		script.Parent.EnterDrive.ProximityPrompt.MaxActivationDistance = 10
	end
end)
1 Like

Your code isn’t reaching the re-increase of the Proximity Prompt Max Activation distance, have you got any errors spewing up? Try placing a print("") somewhere in the code of ChildRemoved() to see if it prints.

I’d also use Enabled over MaxActivationDistance if you don’t want people to use it in that time period.

so the code is working just fine, as it is running and the proximity prompt is enabling/disabling, but it appears to be a problem with client-side because everything on the server is just fine. But I don’t think you can change proximity prompt props on client, can you?

  • by the way thanks for the lightning fast response

No, you should be handling all changes to the Proximity prompt server sided. Perhaps do that - ask the server to enable/disable the proximity prompt.

I put the script in a server script, the prompt has lineofsight: false, and I’m now using enable = true/false. However, I am still having the same issue. If you need any materials to help me, Ill give them to you. I just dont understand why this isn’t working, as I’ve done everything right.

Drop me a DM on Discord I’ll give you a hand.

Astral#0003

Its been a year, but for anyone wondering i believe it was the chassis that i used was disabling the proximity prompt or something.

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