Not saving "WalkSpeed" to a variable correctly

Okay, I have a script that saves the player’s speed, it saves it to a variable called “speed”, but for some reason in leader stats, when you change WalkSpeed, it does not appear in leader stats, that is, if walk speed is 30, then in leader stats will show that it is 0. Also, if I print speed. value in the script, it will say that it is “nil”. And if I just print speed, it will say that it is userId. Why? Did I set the speed wrong somewhere?
Снимок экрана 2022-12-29 в 16.27.07

Can we see the code for the setDataRemote function please

Yes, here is the setData script. I can also give you getData if you need it
Снимок экрана 2022-12-29 в 16.34.21

There’s also getData

First thing I notice is that since you aren’t returning anything in setDataRemote it should be a RemoteEvent not a RemoteFunction. Now the main issue is nowhere in your setDataRemote nowhere are you setting the value of the Speed in the player’s leaderstats. Second important thing is in your first script you have 2 variables both called speed