Proximity prompt not enabling

Build proximity prompt not enabling after being disabled when int.value is 0 and it prints out “no”.No errors in output.BenchmarkPrompt works but the benchmark dont.I have tried putting the proximity prompt parent in an attachment parented to a block but it still doesnt work.Any solutions?

local main = script.Parent
local Teleport = main.BuildTable.teleport
local BuildPrompt = Teleport.Parent.Interact.Attachment.ProximityPrompt
local remote = game.ReplicatedStorage.Remote.Build
local Benchmark = main.Benchmark
local int = main.Stage
local BenchmarkPrompt = Benchmark.Interact.Benchmark
local Storage = script.Parent.Storage
local CompNumb = Storage.Computers


int.Changed:Connect(function()
	print("Changed")
	if int.Value == 0 then
		BuildPrompt.Enabled = true
		print("no")
		
	else if int.Value == 1 then
			print("yes")
			BenchmarkPrompt.Enabled = true
			
		end
		
	end
end)

i suggest to change the int value into a bool value

int:GetPropertyChangeSignal("Value"):Connect(function()
   if int.Value <= 0 then -- fires if value is less than or equal to 0
      BuildPrompt.Enabled = false
   else -- if condition is not met (greater than 0)
      BuildPrompt.Enabled = true
   end
end)

there is going to be another elseif int.value is 2 also

there will be a number 2 value too so enabling it through if the number is more or equal to 0 would not work

there must be somthing blocking the proxy prompt

ive looked at the prompt in workspace it was disabled.I could enable it through workspace tho and it worked perfectly fine

local NewValues = {
  [1] = false,
  [2] = true,
  [3] = "Some Other Value"

}

int:GetPropertyChangeSignal("Value"):Connect(function()
   if NewValues[int.Value] then
      -- code
   end
end)


1 Like

ok turns out why it didnt enable was because the script saw the enable of the prompt from the point of view of the server while i saw mine from a point of view of a local player.Thats why the server detected that the prompt was enabled.The solution i did was to disable the prompt from a server script.Sorry for that confusion thanks for your contribution guys.I’ll leave it here incase anybody makes the same mistake

1 Like

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