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)
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)
local NewValues = {
[1] = false,
[2] = true,
[3] = "Some Other Value"
}
int:GetPropertyChangeSignal("Value"):Connect(function()
if NewValues[int.Value] then
-- code
end
end)
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