so i have this pretty basic script that is used to update the players speed based on some leaderstast. but the problem i have is it does update the players stats but it ignores the other part of the math equation while doing so. if it doesnt make sense just take a look at the script:
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
player.stats.Speed.Changed:Connect(function()
local mult = character.SpeedMult
character.Humanoid.WalkSpeed = (player.stats.Speed.Value/mult.Value + 16)
end)
end)
end)
so when the players leaderstat Speed is changed its supposed to update the Characters speed. in the math equation it divides the players speed leaderstat with a intvalue called "SpeedMult" i named it mult in the script. when the mult changed through a server script the value might change from dividing the leaderstat with 1500 to maybe 30000 and the players speed stays the same.i want to make it where if the value changes the player gets slower because its being divided by a bigger number. im not sure how to do this though, ive tried doing if the value is changed then update the players speed but then it would only update if the player updates his or her speedmult value. if anyone knows what im trying to do and knows how i can do it then pls help.
