Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

function arguments expected near 'end'?

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

2 comments

0

you forgot to write () after :BreakJoints

0

Oh my god, I feel like an idiot now, thank you!

1 answer

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

1 comment

0

Oh, wait just saw Mokiros's answer .-. my bad!

This discussion is preserved as it was. New answers, comments, and votes are closed.