Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's wrong with my syntax? End statement is expecting a ')' for some reason.

Asked by 7 years ago

This code is meant to press a button down

script.Parent.Touched:connect(function(pressed) -- fuction that checks for press
    if pressed and pressed.Parent and pressed.Parent:FindFirstChild("Humanoid") and script.Parent.IsNotPressed == true then -- checks if its being pressed by a player and if it hasnt already been pushed
        pressage() -- function that moves the button
        else
            print( "its already pressed dummy" )
            end
        end
    end -- error : 29: ')' expected (to close '(' at line 22) near 'end'
end)

At the second to last end statement, the console throws out Workspace.button.counter:29: ')' expected (to close '(' at line 22) near 'end' and my script breaks.

I can't understand the the error is trying to say.

0
Entire script? You only show part of it. This might be the wrong part. H4X0MSYT 536 — 7y
0
Sorry, I forgot to mention the section I listed was 22-30 Manwich1 5 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

fixed! I had too many ends in my code just shaving it down a bit fixed it

script.Parent.Touched:connect(function(pressed) -- fuction that checks for press
    if pressed and pressed.Parent and pressed.Parent:FindFirstChild("Humanoid") and script.Parent.IsNotPressed == true then -- checks if its being pressed by a player and if it hasnt already been pushed
        pressage() -- function that moves the button
    else
        print( "its already pressed dumbass" )
    end
end)
Ad

Answer this question