Syntax error: Expected identifier when parsing function name, got '('

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    get rid of this error
  2. What is the issue? Include screenshots / videos if possible!
    Syntax error: Expected identifier when parsing function name, got ‘(’
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Nothing, cause don’t know, and did look for solutions.
local plr = game.Players.LocalPlayer

function(plr)
	wait(2)
	for i,b in pairs(plr.Character:GetChildren()) do
		if b.ClassName == "CharacterMesh" then
			b:Destroy()
		end
	end
	if plr.Character:FindFirstChild("Head") then
		local head = plr.Character:FindFirstChild("Head")
		if head:FindFirstChild("Mesh") then
			local headmesh = head:FindFirstChild("Mesh")
			headmesh.MeshType = "Head"
			headmesh.Scale = Vector3.new(1.25, 1.25, 1.25)
		end
	end
	plr.CharacterAdded:Connect(function(chr)
		repeat wait(0.1) until chr:FindFirstChildWhichIsA("CharacterMesh") do
			for i,v in pairs(chr:GetChildren()) do
				if v.ClassName == "CharacterMesh" then
					v:Destroy()
				end
			end
		end
		if plr.Character:FindFirstChild("Head") then
			local head = plr.Character:FindFirstChild("Head")
			if head:FindFirstChild("Mesh") then
				local headmesh = head:FindFirstChild("Mesh")
				headmesh.MeshType = "Head"
				headmesh.Scale = Vector3.new(1.25, 1.25, 1.25)
			end
		end
	end)
end)

function(plr) should be changed to local function NameForFunctionHere(plr)

and the last end) should be changed to end.

1 Like