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

Expected identifier when parsing method name, got '(' ? What does it mean?

I keep getting the same error and I have no idea how to fix it. I am new to scripting and I was following this tutorial here: https://www.youtube.com/watch?v=vh8Ggpp_RR4

Code:

Enabled = true

script.Parent.OnServerEvent:Connect(function(Player, Action, V1)
	local c = Player.Character
	if Enabled == false then return end
	if Action == "AS" then
		local Punch = Instance.new("Animation")
		Punch.AnimationId = "rbxassetid=5236034047"
		local Anim = c.Humanoid.LoadAnimation:(Punch)
		Anim:Play()
		wait(0.2)
		local Region = Region3.new(V1-Vector3.new(3,3,3),V1+Vector3.new(3,3,3))
		local RTable = workspace:FindPartsInRegion3(Region,nil,20)
		for i,v in pairs(RTable) do
			if v.Parent:FindFirstChild("Humanoid")and v.Parent:FindFirstChild("Deb") == nil and v.parent ~=c then
				local Deb = Instance.new("BoolValue",v.Parent)
				Deb.Name = "Deb"
				game.Debris:AddItem(Deb,0.2)
				v.Parent.Humanoid:TakeDamage(20)
			end
		end
	end
end)

2 comments

0

Put that in a code block please

0

It is in a code block now

1 answer

You Made A Typo On Line 9.

Here Is The Fixed Code:

Enabled = true

script.Parent.OnServerEvent:Connect(function(Player, Action, V1)
    local c = Player.Character
    if Enabled == false then return end
    if Action == "AS" then
        local Punch = Instance.new("Animation")
        Punch.AnimationId = "rbxassetid=5236034047"
        local Anim = c.Humanoid.LoadAnimation(Punch)
        Anim:Play()
        wait(0.2)
        local Region = Region3.new(V1-Vector3.new(3,3,3),V1+Vector3.new(3,3,3))
        local RTable = workspace:FindPartsInRegion3(Region,nil,20)
        for i,v in pairs(RTable) do
            if v.Parent:FindFirstChild("Humanoid")and v.Parent:FindFirstChild("Deb") == nil and v.parent ~=c then
                local Deb = Instance.new("BoolValue",v.Parent)
                Deb.Name = "Deb"
                game.Debris:AddItem(Deb,0.2)
                v.Parent.Humanoid:TakeDamage(20)
            end
        end
	end
end)

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