How to change int value by an another script

Hey there! Yes I know it was asked really often and it was answered but I didn’t find an answer for my project…
I’m trying to make a skill stat like M&B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Skills : MonoBehaviour
{
         
            void Start()
    {
		int Strenght = 5;
		int Intelligence = 5;
		int Stealth = 5;
		int Charisma = 5 ;
		int Agility = 5;
		int Luck = 5;
    }

So this is the base idea and I want to change this by a button press and yea… I couldn’t figure it out how could I do that with the Unity’s UI button.

First of all you need to make the variables local to the class space by defining them in the class body instead of inside the function. Then you need to make a function to change the ones you want and add it to the OnClick events of your button.

     using UnityEngine;
     
     public class Skills : MonoBehaviour
     {

         int Strenght = 5;
         int Intelligence = 5;
         int Stealth = 5;
         int Charisma = 5 ;
         int Agility = 5;
         int Luck = 5;
              
         public void ChangeStat(){
              //assign this function to your Button
             Stealth += 1;
             Luck += 1;
         }
    }