local uis = game:GetService("UserInputService") local h = game.Players.LocalPlayer.Character:WaitForChild("Humanoid") uis.InputBegan:Connect(function(input) local keyIn = input.KeyCode if keyIn == Enum.KeyCode.Q then print("left shift") h.WalkSpeed = 25 end end)
The script is parented in Starter player scripts and it's a local script What am i doing wrong?
Here is the fix:
local UIS = game:GetService("UserInputService") local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() -- character might not have been created yet. local Humanoid = Character:WaitForChild("Humanoid") UIS.InputBegan:Connect(function(Key, gameProcessedEvent) if Key.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent then Humanoid.WalkSpeed = 25 end end)
Hope this helped.