I’ve tried to make a script for a fridge, but it doesn’t work :(.
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Quantity.Value > 0 then
local plr = game.Players.LocalPlayer
local tool = game.Lighting.Popsicle:Clone()
script.Parent.Quantity.Value = script.Parent.Quantity.Value - 1
tool.Parent = plr.Backpack
script.Parent.Parent.Parent.Visible = false
else
script.Parent.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
script.Parent.Text = "Out of Stock"
wait(1)
script.Parent.BackgroundColor3 = Color3.fromRGB(212, 212, 212)
script.Parent.Text = "Popsicle"
wait(0.5)
script.Parent.Parent.Parent.Visible = false
end
end)
It’s supposed to stop giving the tool if the quantity is equal to 0. But it just KEEPS GOING! It worked when I first ran the script then I published the game and visited the script later on. But now it’s not working.