You are setting the value of a local variable you created, the walkspeed of the player is not affected.
Step by step, this is what your current code does:
Listen on the server event "SPHandler"
game.ReplicatedStorage.Events.SPHandler.OnServerEvent:Connect(function(player)
Check value of Coins. If it is over or equal 100, progress.
if player.leaderstats.Coins.Value >= 100 then
Assign the value of Humanoid.WalkSpeed to a local variable.
This is crucial, because you are not making a reference to the property, you are getting the value of the property and making a new local variable, containing the value.
local walkspeed = player.Character.Humanoid.WalkSpeed
Remove 100 coins from the player
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value -100
Add 1 to the local variable "walkspeed"
walkspeed = walkspeed +1
(a bunch of ends)
To fix this issue, you should, instead of doing this:
game.ReplicatedStorage.Events.SPHandler.OnServerEvent:Connect(function(player)
if player.leaderstats.Coins.Value >= 100 then
local walkspeed = player.Character.Humanoid.WalkSpeed
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value -100
**walkspeed = walkspeed +1**
end
end)
Change the line in bold to
player.Character.Humanoid.WalkSpeed = walkspeed + 1
Or:
game.ReplicatedStorage.Events.SPHandler.OnServerEvent:Connect(function(player)
if player.leaderstats.Coins.Value >= 100 then
local walkspeed = player.Character.Humanoid.WalkSpeed
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value -100
player.Character.Humanoid.WalkSpeed = walkspeed +1
end
end)