Help https://gyazo.com/9370c11f61a8ac392097138428b9a343 A gif of me doing it in studio

The error 14:03:01.276 - Players.Coder_1.PlayerGui.set.Frame.TextButton.LocalScript:6: attempt to compare number and nil

lua
--source of error
if speed > max then
--my max is defined before this 
local max =  game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Points").Value /20 +1
-- i gave it enough time for it to load so its not time and every player has a value?

Any help is taken thanks!!

2 comments

0

I suggest using tonumber as it converts a string to a number.

0

Can you show us what you have "speed" defined as?