My run/walk script is having an error at the 2 ends with brackets cant figure out why.
The error is Expected identifier when parsing expression, got ‘)’
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
local RunService = game:GetService("RunService")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://9782831813"
local playanim = humanoid:LoadAnimation(anim)
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftShift then
script.Parent:WaitForChild("Humanoid").WalkSpeed = 30
if script.Parent.Humanoid then
playanim:Play()
end
end)
UIS.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftShift then
script.Parent:WaitForChild("Humanoid").WalkSpeed = 16
if script.Parent.Humanoid then
playanim:Stop()
end
end)