Hello, I have a shop script that gives speed, however I want to make a speed cap on the shop and I get an error (title)
local speedcap = 50
elseif item == "Speed" then
if not player.Speed.Value >= speedcap then
player.Speed.Value = player.Speed.Value + 5
player.Character.Humanoid.WalkSpeed = player.Speed.Value
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - price
return true
end
Is there any way to overcome this? Any help is appreciated!

2 comments
Please provide the entire script.
I cant help you because I don't know what information is assigned to the locals.