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

This script isn't running because he needs "function arguements" Help?

So I have a script placed in Workspace as well as a BindableFunction that forces the script to update. Basically, the script is suppose to remove all weapons if you are on a team. I have scripts that award you weapons if you have a gamepass, and that is why I want this script to remove tools. In case people have these weapons inside the lobby. Anyways, the output says "Workspace.Script:8: function arguments expected near 'for'" I'm actually not sure what a function argument is, I tried the Wiki. I couldn't understand it. If someone could also give a briefing on what that is, it would be very helpful. Here is the script.

local Workspace = script.Parent
local ForceUpdateFunction = Workspace:WaitForChild("ForceUpdate")

local function Update()
	local player = game.Players.LocalPlayer
	if player.TeamColor == game.Teams.Lobby.TeamColor then
		local p = player.Backpack:GetChildren
		for i = 1,#p do
			p[i]:Remove()
		end
	end
end
function ForceUpdateFunction.OnInvoke()
	Update()
end
while true do
	wait(2)
	Update()
end

1 answer

I think your problem is in line 7, simply because you forgot the two parentheses after GetChildren. It should be GetChildren().

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