Here is my code:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Speed = player.leaderstats:WaitForChild("Speed") or player.leaderstats.Speed
Speed.Changed:connect(function()
character.Humanoid.Walkspeed = Speed + 1
end)
When I go into test and change the intvalue of speed on my player. it returns the error: Attempt to perform arithmetic on upvalue 'vitality' (a userdata value)
I have this script in starterplayer script.
the "speed" is a intvalue located in a leaderstats folder in the localplayer directory
I have tried adding wait() to see if it would catch it but nothing seems to work
what should I do?

1 comment
This! I tried it and it worked, thank-you!