I'm working on a game. What did I do wrong with the leaderstats?
Players.Player1.PlayerGui.Menu1.MainMenu:115: attempt to compare number with userdata local dagcount = 0 local function daggerclicked() if player.leaderstats2.Level >= 5 then dagcount = dagcount + 1 if dagcount == 1 then dagger.Text = "Dagger: Owned" elseif dagcount == 2 then dagger.Text = "Dagger: Equipped" dagcount = 0 end end end
You have if player.leaderstats2.Level >= 5 then
and I presume that this is line 115 in your original script. If that's correct, then the error is occurring because "Level" is an IntValue, and when lua sees "IntValue >= 5" it doesn't know what to do. You need to index it with .Value
first, like so:
if player.leaderstats2.Level.Value >= 5 then
In the future, you should specify which line in the script you provided is the same as line 115 in your original script. I also recommend looking up how to indent properly.