I made this small script and placed it in StarterPack but it's not working. It's supposed to add 50 speed everytime I press "q".
player = game.Players.LocalPlayer mouse = player:GetMouse() c = player.Character h = c.Humanoid ws = h.WalkSpeed mouse.KeyDown:Connect(function(key) if (key == "q") then ws = ws + 50 end end)
I have not tested it out, it might not work. An important thing is that you should put local before each of your variables. An another important thing that you should use is UserInputService or ContextActionService, both of those services do a lot(ContextActionService can create custom buttons on the screen and with UserInputService, you could check what device the player is using and much more stuff)
local player = game.Players.LocalPlayer local uis = game:GetService("UserInputService") local char = player.Character local hum = char.Humanoid local amount = 50 uis.InputBegan:Connect(function(key, gpe) if key.KeyCode == Enum.KeyCode.Q and not gpe then -- gpe stands for GameProcessedEvent hum.WalkSpeed = hum.WalkSpeed + amount end end)