I have this problem. I can't change it with codes! He doesn't send me any error too. These is my code.
local Player = game.Players.LocalPlayer
local Character = Player.Character.Humanoid
local WalkSpeed = Character.WalkSpeed
local ControlHolding = false
local MoveHolding = false
local Animation = Instance.new("Animation")
Animation.AnimationId = "http://www.roblox.com/asset/?id=1909808255"
local Animation2 = Instance.new("Animation")
Animation2.AnimationId = "http://www.roblox.com/asset/?id=1909810268"
local Squating = Character:LoadAnimation(Animation)
local SquatMoving = Character:LoadAnimation(Animation2)
local IdleAnimation = Character:LoadAnimation(game.Players.LocalPlayer.Character.Animate.idle.Animation1)
local WalkAnimation = Character:LoadAnimation(game.Players.LocalPlayer.Character.Animate.walk.WalkAnim)
Squating.Looped = true
SquatMoving.Looped = true
game:GetService('UserInputService').InputBegan:Connect(function(input,IsTyping)
if IsTyping then return end
local KeyPressed = input.KeyCode
if KeyPressed == Enum.KeyCode.LeftControl then
ControlHolding = true
WalkSpeed = 0 --This! Also i printed it, he shows me 0 too.
if MoveHolding == true then
WalkAnimation:stop()
IdleAnimation:stop()
SquatMoving:play()
else
SquatMoving:stop()
WalkAnimation:stop()
IdleAnimation:stop()
Squating:play()
end
end
function onKeyRelease(inputObject,gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.LeftControl then
ControlHolding = false
Squating:stop()
SquatMoving:stop()
WalkSpeed = 15 --Here gets problem too maybe?
end
end
game:GetService("UserInputService").InputEnded:connect(onKeyRelease)
Yes i actually making a squating script, and i just can't change player's speed! I want to know why. By the way this is not all my codes. And Thanks for helping!

4 comments
Ooooh! So i can't local it right?
Making it into a variable will just store the value, so no you can't directly make properties into variables
Okay! i'm gonna try it.
It's WORKED! Thank you for help!!