Why doesn't this prox work?

oh, make it => instead of >= and please let me see the output

does this script look like it should be?

local canbuy
local prox = script.Parent

local wall = script.Parent.Parent.Parent.wall
print("1")
canbuy = false

local players = game:GetService("Players")

local player = players.LocalPlayer

local fuel = player.leaderstats.fuel
print("2")
script.Parent.Triggered:Connect(function()
	print("3")
	while wait(1) do
		if fuel.Value >= 50 then
			canbuy = true
		end
	end
	print("4")
	if canbuy == true then
		print("6")
		fuel.Value = fuel.Value + -50
		canbuy = false
	else
		print("7")
		fuel.Value = fuel.Value + 0
	end
end)

the reason i won’t show you is cause there is nothing about the script in the output

Please read the answer I wrote, this one will not work because code will not continue because of the while loop, also there is no need for loop.

You can use this instead fuel.Value -= 50 to subtract and fuel.Value += 50 to add.

try

fuel.Value = fuel.Value - 50

maybe I’m wrong if I am check this

Changing Fuel value by localscript won’t effect to server due to filtering enabled.
You must handle ProximyPrompt’s event by server and send RemoteEvent to client to delete wall.

This is literally what I said but the owner of the post did not care.

1 Like