Problem With Leveling | Help

Hello! I’m Making A Dragon Ball Game, I Would Like To Create A Script That Doesn’t Run Another Script If The Player Doesn’t Have A Certain Level Set With A Leveling System With Values

My Idea:
Do Something Like: if EXP.Value == 10 then | but it does not work.

  • image of the order of values
    image

I mean, I would like to Lock A Button [Button to Equip the Skill] for those who do not have a certain level established with the Value of the image above!

Hope you can help me!
You can also contact me on Discord [NaturalGold # 6969]

ATTENTION; THIS IS A REPOST WITH MORE INFO
[EDIT]

if you want level, dont you need to check Level.Value?

Also, you used EXP.Value == 10, that would ONLY work if your EXP.Value is exactly 10, use >= (Greater or equal than) so if Level.Value >= 10 do stuff

Yeah, But To Test I Put XP.
because first I would like to make sure that the script works before applying it to all buttons,

where did you create those values, in a local or a server script?

The Script Under The Button Is A Local Script, But I Have Tested It On Both Classic And Local Script,

If this is a localscript you can try and do this:

    local player = game:GetService("Players").LocalPlayer

    if player.Stats:FindFirstChild("EXP") then 
       if player.Stats.EXP.Value >= 10 then 
         print("This worked!")
       end
    end

It does not work…
image

Is there anything printed in the output? (errors, warnings, etc?)

No. The orange errors are from the leveling system, no problem with the button.

print(game.Players.LocalPlayer.Stats:WaitForChild(“EXP”).Value) to see if its reading it

He gives me this error,

sorry do this print(game.Players.LocalPlayer.Stats:WaitForChild("EXP").Value)

Same Answer, Same Mistake!
I tried to write "print (game.Players.LocalPlayer.Stats: WaitForChild (" EXP "). Value)" but it gives an error.

dont put ("") before and after the print the ends

I didn’t put it in the script, it was to highlight it here on the devforum.

weird, i created a similar scene and it prints just fine

local _Stats = Instance.new("Folder",game.Players.LocalPlayer)

_Stats.Name = "Stats"

Instance.new("IntValue",_Stats).Name = "EXP"

print(game.Players.LocalPlayer.Stats:WaitForChild("EXP").Value)

those first lines are just for me to have those things in my localplayer

I will work on it, Thanks !!!
Hum, i Hope it works.

I fixed, I recreated the whole system of the game and now I have been able to adjust the levels, thanks for everyone who helped me!