#Script doesn't work

1 messages · Page 1 of 1 (latest)

smoky cedar
#

It gives a syntax error on line 26

code:

local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local char = script.Parent
local hum = char:WaitForChild("Humanoid")

local normSpd = 16
local sprintSpd = 24
local isSprinting = false

local function startSprint()
    if not isSprinting then
        isSprinting = true
        hum.WalkSpeed = sprintSpd
    end
end

local function stopSprint()
    if isSprinting then
        isSprinting = false
        hum.WalkSpeed = normSpd
    end
end

UIS.InputBegan:Connect(function(input, gp)
    if gp then return end
    if input.KeyCode = Enum.KeyCode.LeftShift then
        startSprint()
    end
end)

UIS.InputEnded:Connect(function(input, gp)
    if input.KeyCode == Enum.KeyCode.LeftShift then
        stopSprint()
    end
end)

hum.Died:Connect(function()
    isSprinting = false
end)
#

anything i might've done wrong?

sharp osprey
#

== instead of =