Im trying to get a value of a StringValue but keeps saying in the output " 22:47:37.989 - Players.dizzyjamison08.PlayerGui.Shop.Stats.TextButton.LocalScript:6: attempt to index a nil value" im using filtering enabled and the values not nil, i checked. heres the script
axe = script.Parent.Parent.Axe.Value script.Parent.MouseButton1Click:Connect(function(player) if game.Players.LocalPlayer.leaderstats.Bux.Value >= script.Parent.Parent.Pricie.Value then print("Not Poor") local equip = game.Lighting:FindFirstChild(axe):Clone() equip.Parent = game.Players.LocalPlayer.Backpack end end)
Your issue is being caused because axe
doesn’t have a value, therefore whilst indexing an object using axe
‘s StringValue as a reference, it will come out as nil, since it’s indexing for nothing