The name 'lspikeclone' does not exist in the current context

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class PlayerMovement : MonoBehaviour
{
    public Rigidbody2D rb;
    public GameObject MainMenuUI;
    public GameObject DeathMenuUI;
    public GameObject LeftSpikePrefab;
    public GameObject RightSpikePrefab;
    Vector2 movement;
    public int score = 0;
    int[] leftspike = new int[10];
    int i=1,c=0,moveSpeed=4;
    void Start()
    {
        Time.timeScale = 0;
        MainMenuUI.SetActive(true);
        movement.x = 1;
        movement.y = 0;
    }
  
    void Update()
    {
        movement.y = movement.y - 2 * Time.deltaTime;
         rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
    }
    //JUMPING
    public void Jump()
    {
        Time.timeScale = 1;
        MainMenuUI.SetActive(false);
        movement.y = movement.y + 100 * Time.deltaTime;
    }
    //SPAWNING SPIKES
    void SpawnRightSpike(int i)
    {
        for (; i >= 0; i--)
        {
            GameObject rspikeclone = Instantiate(RightSpikePrefab, new Vector2(2.7f, Random.Range(-4, 4)), Quaternion.identity) as GameObject;
        }
    }
    void SpawnLeftSpike(int i)
    {
        for (; i >= 0; i--)
        {
            GameObject lspikeclone = Instantiate(LeftSpikePrefab, new Vector2(2.7f, Random.Range(-4, 4)), Quaternion.identity) as GameObject;
        }
    }
    //DESTROYING SPIKES
    void DestroyLeftSpike(int i)
    {
        for (; i >= 0; i--)
            Destroy(lspikeclone);
    }
    void DestroyRightSpike(int i)
    {
        for (; i >= 0; i--)
            Destroy(rspikeclone);
    }
    //COLLISSION DETECTION
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.gameObject.tag == "Spike")
        {
            DeathMenuUI.SetActive(true);
            Time.timeScale = 0;
        }
        if (collider.gameObject.tag == "LeftBorder")
        {
            movement.x = 1;
            transform.localRotation = Quaternion.Euler(0, 360, 0);
            score++;
            SpawnRightSpike(i);
            DestroyLeftSpike(i);
            if (i < 7)
            {
                if (c == i)
                {
                    i++;
                    c = 0;
                }
                else
                {
                    c++;
                }
            }
        }
        if (collider.gameObject.tag == "RightBorder")
        {
            movement.x = -1;
            transform.localRotation = Quaternion.Euler(0, 180, 0);
            score++;
            SpawnLeftSpike(i);
            DestroyRightSpike(i);
            if (i < 7)
            {
                if (c == i)
                {
                    i++;
                    c = 0;
                }
                else
                {
                    c++;
                }
            }
        }
    }
}

I’m a beginner and this is my first game that I’m trying to make but I don’t know how to solve this error.I would be thankful if anyone could help me

You declare the local variable on line 51, and when you do that it’s valid only inside that { } code block.

Declare the variable (GameObject lspikeclone;) outside the function, and just do the assignment part in that loop. Then it will be accessible everywhere in the class.

Thank you so much