#(SOLVED) Expected identifier when parsing expression, got ')'

1 messages · Page 1 of 1 (latest)

cold quarry
#

just doing some recodes and roblox studio tells me i have something wrong in my script and it only has the ")" highlighted
heres the code

UserInputService.InputEnded:Connect(function(input)
    print("WalkSpeed: " .. tonumber(Humanoid.WalkSpeed))
    print("Moving?: " .. tostring(AmMoving))
    print("Running: " .. tostring(AmRunning))
    print("Stamina: " .. tonumber(MyStamina) .. " / ".. tonumber(MyMaxStamina))
    if input.KeyCode == Enum.KeyCode.W then
        Is_W = false
    end
    if input.KeyCode == Enum.KeyCode.A then
        Is_A = false
    end
    if input.KeyCode == Enum.KeyCode.S then
        Is_S = false
    end
    if input.KeyCode == Enum.KeyCode.D then
        Is_D = false
    end

    if Is_W == false then
        AmMoving = false
    else 
        if Is_A == false then
            AmMoving = false
        else
            if Is_S == false then
                AmMoving = false
            else
                if Is_D == false then
                    AmMoving = false
            end
        end
    end


    if input.KeyCode == Enum.KeyCode.LeftShift then
        AmRunning = false
        Humanoid.WalkSpeed = MyWalkspeed
    end

    while AmRunning == false do
        print("WalkSpeed: " .. tonumber(Humanoid.WalkSpeed))
        print("Moving?: " .. tostring(AmMoving))
        print("Running: " .. tostring(AmRunning))
        print("Stamina: " .. tonumber(MyStamina) .. " / ".. tonumber(MyMaxStamina))
        if MyStamina < MyMaxStamina then
            MyStamina = MyStamina + 1
        end
        task.wait(0.1)
        end
end) -- The highlighted ")" is in this line

steel plinth
#

In which line is the error?

steel plinth
#

ah bruh

toxic osprey
#

When u write end u dont put a )

cold quarry
#

i swear it has all the ends that it need 🥀

toxic osprey
#

Just remove the )

cold quarry
toxic osprey
#

Gmme the output whit the removed )

cold quarry
#

20:26:06.456 Workspace.KarrotKaik.SprintScript:145: Expected identifier when parsing expression, got ')' - Studio - SprintScript:145
heres the output with the bracket

20:27:05.376 Workspace.KarrotKaik.SprintScript:145: Expected 'end' (to close 'function' at line 95), got <eof>; did you forget to close 'then' at line 140? - Studio - SprintScript:145
heres after

toxic osprey
#

U forgot to close the function at line 95

cold quarry
#
        if MyStamina < MyMaxStamina then
            MyStamina = MyStamina + 1
        end

this is whats at line 140

cold quarry
toxic osprey
#

It has to be

if MyStamina < MyMaxStamina then
           MyStamina = MyStamina + 1
end
cold quarry
#

wai but thats just the same

short glade
#

Are you sure it has all ends?

cold quarry
#

omg thank you so much

#

yess its been solved yippee

cold quarry
#

(SOLVED) Expected identifier when parsing expression, got ')'

short glade