Hi I was scripting this game and I came across an error in the output that said "ClassicSword is not a valid member of StarterGear." Can you help?
price = 550
plr = game.Players.LocalPlayer
debounce = false
if plr.StarterGear.ClassicSword.Configurations.LungeDamage == 50 then
script.Parent.Active = false
script.Parent.Visible = false
elseif plr.StarterGear.ClassicSword.Configurations.LungeDamage > 50 or plr.StarterGear.ClassicSword.Configurations.LungeDamage < 50 then
script.Parent.MouseButton1Click:connect(function()
if debounce then return end
local v = plr.leaderstats.Credits
debounce = true
if v.Value >= price then
plr.StarterGear.ClassicSword.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.Active = true
script.Parent.Parent.upgrade2.Visible = true
script.Parent.Parent.error.Position = UDim2.new(0, 200, 0, 100)
script.Parent.Parent.Buy.Position = UDim2.new(0, 200, 0, 100)
print('You bought the item!')
else
print ('Cant buy item!')
script.Parent.Parent.error.Visible = true
script.Parent.Parent.Parent.Frame.error2.Text = "You need "..550 - plr.leaderstats.Credits.Value.." more Credits to buy this!"
script.Parent.Parent.error.TextTransparency = 0
script.Parent.Parent.error2.TextTransparency = 0
wait(2)
for i = .1,1,.1 do
wait(0.1)
script.Parent.Parent.error.TextTransparency = i
script.Parent.Parent.error2.TextTransparency = i
end
end
debounce = false
end)
end

7 comments
backpack didn't work
"Backpack", not "backpack"
Yes I know it still didn't work :(
It still says sword is not a valid member of Backpack
Is ClassicSword a member of StarterPack?
Use WaitForChild instead of indexing it directly if you're expecting it to be there and it isn't yet.
^