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

function arguments expected near 'end'?

Asked by
Daanni 10
8 years ago
function endRound()
        for _,v in pairs(game.Players:GetChildren()) do -- for everything in players
            if v.Character ~= nil then --  if ther person is existing
            v.Character:BreakJoints -- kills

            end --this is the end that is underlined in red
        end -- ends function
        game.Workspace.Model:Remove()

end

This is the code, the error I'm getting is that function arguments expected near end

0
you forgot to write () after :BreakJoints Mokiros 135 — 8y
0
Oh my god, I feel like an idiot now, thank you! Daanni 10 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Problem

you forgot to put paranthese over :BreakJoints. this breaks the script as break joints is a function and it needs paranthese

Solution

function endRound()
        for _,v in pairs(game.Players:GetChildren()) do -- for everything in players
            if v.Character ~= nil then --  if ther person is existing
            v.Character:BreakJoints() -- kills

            end --this is the end that is underlined in red
        end -- ends function
        game.Workspace.Model:Remove()

end
0
Oh, wait just saw Mokiros's answer .-. my bad! User#5978 25 — 8y
Ad

Answer this question