Hello, i need help with a script i can´t make exactly what i want :
Is a running script, the players runs when is pressed, the problem is that the animation is played with just pressing Left shift, so player running animatio is playing in same spot at least he press any letter from WASD
So I try to make the animation only run if the player presses shift + any letter of “WASD”
Script:
local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and Enum.KeyCode.W then
Character.Humanoid.WalkSpeed = 35
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://10584320932'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)
I’m not too great of a scripter (I’ve had this issue before) but input.KeyCode can only be triggered with a single key if I’m correct? Maybe set up a tree of RemoteEvents that fire when the player presses a key? Boolean values? I don’t really know.
--uhhh ummmm i don't know
local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and script.W.Value == true or input.KeyCode == Enum.KeyCode.LeftShift and script.A.Value == true or input.KeyCode == Enum.KeyCode.LeftShift and script.S.Value == true or input.KeyCode == Enum.KeyCode.LeftShift and script.D.Value == true then
Character.Humanoid.WalkSpeed = 35
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://10584320932'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)