So I'm doing a purchase system and when it's purchased it sets the variable
local batowned
too true, but when I press purchase again it purchases it despite batowned being true.
local stripebatowned = false
player = game:GetService("Players").LocalPlayer
if stripebatowned == false then
script.Parent.MouseButton1Click:Connect(function()
if player.leaderstats.Credits.Value >= 1000 then
script.Parent.Text = "Equip"
local stripebatowned = true
player.leaderstats.Credits.Value = player.leaderstats.Credits.Value - 1000
end
end)
end
it should only trigger if stripebatowned = false but it still triggers even when set to true so whats the issue?

2 comments
hmm, I tried this an it still keeps purchasing. Your solution makes a lot of sense but it still wont work.
This should work. The code wont run unless stripebatowned == false. You can test it by doing print(stripebatowned) after you check it and see what it prints.