Hi I was trying to script this shop script and when they bought it the button went away. But if you died and still bought it the button would come back up. Can you help? This is my guess. Everything was working until I added the if then statment at the top. Please help!
price = 550
plr = game.Players.LocalPlayer
debounce = false
if plr.Backpack.ClassicSword.Configurations.LungeDamage == 50 and plr.Startergear.ClassicSword.Configurations.LungeDamage == 50 then
script.Parent.MouseButton1Down:connect(function()
if debounce then return end
local v = plr.leaderstats.Credits
debounce = true
if v.Value >= price then
plr.Backpack.ClassicSword.Configurations.LungeDamage.Value = 50 or plr.Backpack.StarterGear.Configurations.LungeDamage.Value +50
v.Value = v.Value - price
script.Parent.Parent.Buy.Visible = true
wait(0.2)
for i = 0.1,1,0.1 do
wait(0.1)
script.Parent.Parent.Buy.TextTransparency = i
end
script.Parent.Active = false
script.Parent.Visible = false
script.Parent.Parent.upgrade2.Visible = true
script.Parent.Parent.Buy.Position = UDim2.new(0, 200, 0, 100)
print('You bought the item!')
else
print ('Cant buy item!')
script.Parent.Parent.Nope.Visible = true
script.Parent.Parent.Parent.Frame.Nope2.Text = "You need "..550 - plr.leaderstats.Credits.Value.." more Credits to buy this!"
script.Parent.Parent.Nope.TextTransparency = 0
script.Parent.Parent.Nope2.TextTransparency = 0
wait(2)
for i = .1,1,.1 do
wait(0.1)
script.Parent.Parent.Nope.TextTransparency = i
script.Parent.Parent.Nope2.TextTransparency = i
end
end
debounce = false
end)
else
script.Parent.Active = false
script.Parent.Visible = false
end

2 comments
How would I approach it?
Add .Value after the two references to LungeDamage on line 4.