#how would i go about checking player movement
19 messages · Page 1 of 1 (latest)
Check the player.Character.HumanoidRootPart’s velocity
mmm thank you ill try it out
u can use cframe moved if u want a event
Humanoid:GetState()
if Humanoid:GetState() == Enum.HumanoidStateType.Running then
unknown global humanoid 
hmm wont work
this is the entire code btw
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 then
if Character.Humanoid:GetState() == Enum.HumanoidStateType.Running then
Character.Humanoid.WalkSpeed = 25
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://nuh uh'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)
i got it to work like this ```
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 then
if Character.Humanoid.MoveDirection.Magnitude > 0 then
Character.Humanoid.WalkSpeed = 25
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://15194215737'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)
but if i stop walking but still hold shift it keeps running the animation
hmmm
ill have to write a loop that checks for movedir ?
i can change if -> while ?
Where is the script located?
