#Can anyone tell me how to fix: Expected 'then' when parsing if statement, got '='

4 messages · Page 1 of 1 (latest)

exotic mist
#

Here is the script that causes trouble:
UserInputService.InputBegan:Connect(function(input:InputObject)
if input.KeyCode = Enum.KeyCode.LeftShift then
if humanoid then
humanoid.WalkSpeed = 30
end
end
end)

UserInputService.InputEnded:Connect(function(input:InputObject)
if input.KeyCode = Enum.KeyCode.LeftShift then
if humanoid then
humanoid.WalkSpeed = 16
end
end
end)

it says line 22 on InputBegan, but i have then after the if statement -_-

silk rune
#

you need to type == in an if statement

alpine pewter
#

if you want to do an equal operation on an if statement

alpine pewter