I'm trying to make a perk for my game which gives the player +10% WalkSpeed
, but it doesn't really work. I don't know how I should change it either, whether it is through inserting a Humanoid
into players or using LocalPlayer.character
. Here is my code:
EquipButton.MouseButton1Down:connect(function() if InventoryItemImage.Image == "rblxassetid://769111505" then local HumanoidSpeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed if wins.Value >= 50 then HumanoidSpeed = HumanoidSpeed * 2 elseif wins.Value >= 45 then HumanoidSpeed = HumanoidSpeed * 1.9 elseif wins.Value >= 40 then HumanoidSpeed = HumanoidSpeed * 1.8 elseif wins.Value >= 35 then HumanoidSpeed = HumanoidSpeed * 1.7 elseif wins.Value >= 30 then HumanoidSpeed = HumanoidSpeed * 1.6 elseif wins.Value >= 25 then HumanoidSpeed = HumanoidSpeed * 1.5 elseif wins.Value >= 20 then HumanoidSpeed = HumanoidSpeed * 1.4 elseif wins.Value >= 15 then HumanoidSpeed = HumanoidSpeed * 1.3 elseif wins.Value >= 10 then HumanoidSpeed = HumanoidSpeed * 1.2 elseif wins.Value >= 5 then HumanoidSpeed = HumanoidSpeed * 1.1 end end end)
There also aren't any errors. Any help is appreciated!