Muchacho Hitbox attempt to call mising method "Start" of table

(Bad English warning)

I am trying to create a combat server script using muchacho hitbox and remote event
When it comes to testing all starts okay but on the 5th eventFire appears Error on 150 line
attempt to call a missing method “Start” of table
I have no idea why

Codes for ServerscriptService where error appears

combat server

local RS=game:GetService("ReplicatedStorage")
local combatEvent=RS.Remotes:WaitForChild("CombatEvent")
local activateEvent=game:GetService("ReplicatedStorage").Remotes:WaitForChild("ActivateEvent")
local debris=game:GetService("Debris")
local bindEvent=script.Parent.ConfigureCharacter.Fire

local animationsFolder=RS.Animations
local soundFolder=RS.Sounds

local modules=RS:WaitForChild("Modules")
local HitboxService=require(modules:WaitForChild("MuchachoHitbox"))
local SlowingService=require(modules:WaitForChild("SlowingService"))

local maxCombo=4
local AirCrit=false
local lastPunch={}
local listOfDebounce={}
local listOfAnimations



for _,player in pairs(game:GetService("Players"):GetChildren()) do
	listOfDebounce[player]=false
end



local function playSound(SoundName,Parent)
	local sound=Instance.new("Sound",Parent)
	sound.SoundId=soundFolder[SoundName].SoundId
	sound.Volume=soundFolder[SoundName].Volume
	sound:Play()
	debris:AddItem(sound,soundFolder[SoundName].TimeLength)
end
	
bindEvent.Event:Connect(function(listToGet)
	listOfAnimations=listToGet
end)

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		char:SetAttribute("Combo",0)
	end)
end)

local function find(Table,value)
	for i,v in pairs(Table) do
		if v.Name==value then
			return v
		end
	end
	return nil
end



local function getAnimation(char,Type,Air)
	print(listOfAnimations)
	if Type=="Combo"then
		local combo=char:GetAttribute("Combo")
		local curranim=find(listOfAnimations["Combo"],"Slice"..tostring(combo))
		return curranim
	elseif Type=="Critical"then
		if not Air then
			local curranim=find(listOfAnimations["Extras"],"Critical")
			return curranim
		else
			local curranim=find(listOfAnimations["Extras"],"AirCritical")
			return curranim
		end
	end


end



local function changeCombo(char)
	local combo=char:GetAttribute("Combo")
	local player=game.Players:GetPlayerFromCharacter(char)
	if not lastPunch[player] then
		lastPunch[player]=os.clock()
	end

	local passedtime=os.clock()-lastPunch[player]

	if passedtime>2 then
		char:SetAttribute("Combo",1)
	else
		if combo<maxCombo then
			char:SetAttribute("Combo",combo+1)	
		else
			char:SetAttribute("Combo",1)	
		end
	end
	lastPunch[player]=os.clock()
end



combatEvent.OnServerEvent:Connect(function(player)
	local character=player.Character
	if character:GetAttribute("HoldingSword")==false then
		return
	end
	local humanoid=character.Humanoid
	local humanoidRootPart=character.HumanoidRootPart
	local animator=humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator",humanoid)

	local attaking=character:GetAttribute("Attacking")
	local stunned=character:GetAttribute("Stunned")
	local debounce=character:GetAttribute("ComboDebounce")
	
	if stunned or attaking or debounce then
		return
	end
	
	local hitbox=HitboxService:CreateHitbox()
	hitbox.Size=Vector3.new(7, 1, 6)
	hitbox.CFrame=humanoidRootPart
	hitbox.Offset=CFrame.new(0,0,-5)
	
	character:SetAttribute("Attacking",true)
	character:SetAttribute("ComboDebounce",true)

	local playAnimation=getAnimation(character,"Combo")

	changeCombo(character)
	

	

	
	SlowingService.Slow(humanoid,playAnimation.Length+0.5,8,5)
	

	
	hitbox.Touched:Connect(function(hit,Enemy)
		if Enemy then		
			if Enemy~=humanoid and Enemy:IsA("Humanoid") then
				playSound("SwordSlice",humanoidRootPart)
				SlowingService.Slow(Enemy,playAnimation.Length,10,5)
				Enemy:TakeDamage(5)
			end
		end

	end)
	
	local function playHitbox(hitbox,Time)
		hitbox:Start()
		task.wait(Time)
		hitbox:Stop()
	end
	
	
	playAnimation.KeyframeReached:Connect(function(keyframe)
		if keyframe=="Hit" then
			task.spawn(function()
				playSound("SwordSwing",humanoidRootPart)
				playHitbox(hitbox,0.1)
			end)
			task.wait(playAnimation.Length-0.3)
			character:SetAttribute("Attacking",false)	
			
			if character:GetAttribute("Combo")==maxCombo then
				task.wait(2)
			end
		end
		character:SetAttribute("ComboDebounce",false)
	end)
	
	playAnimation:play()
	
end)

Character configuration

local players=game:GetService("Players")
local katanasFolder=game:GetService("ReplicatedStorage").KatanasFolder
local animationsFolder=game:GetService("ReplicatedStorage").Animations
local listToSent={}
players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		
		character.Humanoid.WalkSpeed=20
		character.Humanoid.JumpPower=50
		
		local animator=character.Humanoid.Animator
		
		local KatanaValue=Instance.new("StringValue")
		KatanaValue.Name="Katana"
		KatanaValue.Parent=player.Character
		KatanaValue.Value="Katana basic"
		
		local katana=katanasFolder:FindFirstChild(KatanaValue.Value)
		katana:Clone().Parent=player.Backpack
		
		local afterImageEffect=game:GetService("ReplicatedStorage").Animations.ShadowsDashes:Clone()
		afterImageEffect.Parent=character
		local weld=Instance.new("Weld",character.HumanoidRootPart)
		weld.Part1=character.HumanoidRootPart
		weld.Part0=afterImageEffect
		
		local katanaAnimations=animationsFolder:FindFirstChild(KatanaValue.Value)
		for _,v in pairs(katanaAnimations:GetChildren())do
			listToSent[v.Name]={}
			for index,animation in pairs(v:GetChildren())do
				table.insert(listToSent[v.Name],animator:LoadAnimation(animation))
			end
		end
		
		local bindEvent=script.Fire
		
		bindEvent:Fire(listToSent)
		
		print(listToSent)
		character:SetAttribute("HoldingSword",false)
		character:SetAttribute("Moving",false)
		character:SetAttribute("Attacking",false)
		character:SetAttribute("Stunned",false)
		character:SetAttribute("ComboDebounce",false)
		character:SetAttribute("Combo",1)	
	end)
	
end)

The problem is even more weird because when I loading animation for animator each time when
event is firing problem does not appears

Script where error does not appears
Combat server

local RS=game:GetService("ReplicatedStorage")
local combatEvent=RS.Remotes:WaitForChild("CombatEvent")
local activateEvent=game:GetService("ReplicatedStorage").Remotes:WaitForChild("ActivateEvent")
local debris=game:GetService("Debris")


local animationsFolder=RS.Animations
local soundFolder=RS.Sounds

local modules=RS:WaitForChild("Modules")
local HitboxService=require(modules:WaitForChild("MuchachoHitbox"))
local SlowingService=require(modules:WaitForChild("SlowingService"))

local maxCombo=4
local AirCrit=false
local lastPunch={}
local listOfDebounce={}

for _,player in pairs(game:GetService("Players"):GetChildren()) do
	listOfDebounce[player]=false
end

local function playSound(SoundName,Parent)
	local sound=Instance.new("Sound",Parent)
	sound.SoundId=soundFolder[SoundName].SoundId
	sound.Volume=soundFolder[SoundName].Volume
	sound:Play()
	debris:AddItem(sound,soundFolder[SoundName].TimeLength)
end
	

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		char:SetAttribute("Combo",0)
	end)
end)

local function find(Table,value)
	for i,v in pairs(Table) do
		if v.Name==value then
			return i
		end
	end
	return nil
end

local function getAnimation(char,sword,Type,Air)
	if Type=="Combo"then
		local combo=char:GetAttribute("Combo")
		local anims=animationsFolder[sword].Combo:GetChildren()
		local curranim=anims[combo]
		print(curranim)
		return curranim
	elseif Type=="Critical"then
		if not Air then
			local anims=animationsFolder[sword].Extras:GetChildren()
			local curranim=anims[find(anims,"Critical")]
			return curranim
		else
			local anims=animationsFolder[sword].Extras:GetChildren()
			local curranim=anims[find(anims,"AirCritical")]
			print("Air")
			return curranim
		end
	end


end

local function changeCombo(char)
	local combo=char:GetAttribute("Combo")
	local player=game.Players:GetPlayerFromCharacter(char)
	if not lastPunch[player] then
		lastPunch[player]=os.clock()
	end

	local passedtime=os.clock()-lastPunch[player]

	if passedtime>2 then
		char:SetAttribute("Combo",1)
	else
		if combo<maxCombo then
			char:SetAttribute("Combo",combo+1)	
		else
			char:SetAttribute("Combo",1)	
		end
	end
	lastPunch[player]=os.clock()
end



combatEvent.OnServerEvent:Connect(function(player)
	local character=player.Character
	if character:GetAttribute("HoldingSword")==false then
		return
	end
	local humanoid=character.Humanoid
	local humanoidRootPart=character.HumanoidRootPart
	local animator=humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator",humanoid)

	local attaking=character:GetAttribute("Attacking")
	local stunned=character:GetAttribute("Stunned")
	local debounce=character:GetAttribute("ComboDebounce")
	
	if stunned or attaking or debounce then
		return
	end
	
	
	character:SetAttribute("Attacking",true)
	character:SetAttribute("ComboDebounce",true)

	changeCombo(character)
	

	
	local punchAnim=getAnimation(character,character.Katana.Value,"Combo")
	print(punchAnim)
	local playAnimation=animator:LoadAnimation(punchAnim)
	
	SlowingService.Slow(humanoid,playAnimation.Length+0.5,8,5)
	
	local hitbox=HitboxService:CreateHitbox()
	hitbox.Size=Vector3.new(7, 1, 6)
	hitbox.CFrame=humanoidRootPart
	hitbox.Offset=CFrame.new(0,0,-5)
	
	hitbox.Touched:Connect(function(hit,Enemy)
		if Enemy then		
			if Enemy~=humanoid and Enemy:IsA("Humanoid") then
				playSound("SwordSlice",humanoidRootPart)
				SlowingService.Slow(Enemy,playAnimation.Length,10,5)
				Enemy:TakeDamage(5)
			end
		end

	end)
	
	
	
	playAnimation.KeyframeReached:Connect(function(keyframe)
		if keyframe=="Hit" then
			task.spawn(function()
				playSound("SwordSwing",humanoidRootPart)
				hitbox:Start()
				task.wait(0.1)
				hitbox:Stop()
			end)
			task.wait(playAnimation.Length-0.3)
			character:SetAttribute("Attacking",false)	
			
			if character:GetAttribute("Combo")==maxCombo then
				task.wait(2)
			end
		end
		character:SetAttribute("ComboDebounce",false)
	end)
	
	playAnimation:play()
	
end)

Please help me!

1 Like

Simply means that there is no method named “Start” in the table.

You should also tell us that which line is having the issue and what code is having the issue.

Problem at this code in function PlayHitbox line 150

The main problem that i am so ####### dumb
Also i already find out how to solve my needs
I used code above to solve the problem of animation track which stop working after loading more than 256 animations but then i remebered that I have another script for run and idle animations I reworked it and now all works great even with old combat server script
However I will let topic unsolved
Maybe in future I will find out the root of error

local RS=game:GetService("ReplicatedStorage")
local combatEvent=RS.Remotes:WaitForChild("CombatEvent")
local activateEvent=game:GetService("ReplicatedStorage").Remotes:WaitForChild("ActivateEvent")
local debris=game:GetService("Debris")
local bindEvent=script.Parent.ConfigureCharacter.Fire

local animationsFolder=RS.Animations
local soundFolder=RS.Sounds

local modules=RS:WaitForChild("Modules")
local HitboxService=require(modules:WaitForChild("MuchachoHitbox"))
local SlowingService=require(modules:WaitForChild("SlowingService"))

local maxCombo=4
local AirCrit=false
local lastPunch={}
local listOfDebounce={}
local listOfAnimations



for _,player in pairs(game:GetService("Players"):GetChildren()) do
	listOfDebounce[player]=false
end



local function playSound(SoundName,Parent)
	local sound=Instance.new("Sound",Parent)
	sound.SoundId=soundFolder[SoundName].SoundId
	sound.Volume=soundFolder[SoundName].Volume
	sound:Play()
	debris:AddItem(sound,soundFolder[SoundName].TimeLength)
end

bindEvent.Event:Connect(function(listToGet)
	listOfAnimations=listToGet
end)

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		char:SetAttribute("Combo",0)
	end)
end)

local function find(Table,value)
	for i,v in pairs(Table) do
		if v.Name==value then
			return v
		end
	end
	return nil
end



local function getAnimation(char,Type,Air)
	print(listOfAnimations)
	if Type=="Combo"then
		local combo=char:GetAttribute("Combo")
		local curranim=find(listOfAnimations["Combo"],"Slice"..tostring(combo))
		return curranim
	elseif Type=="Critical"then
		if not Air then
			local curranim=find(listOfAnimations["Extras"],"Critical")
			return curranim
		else
			local curranim=find(listOfAnimations["Extras"],"AirCritical")
			return curranim
		end
	end
end

local function changeCombo(char)
	local combo=char:GetAttribute("Combo")
	local player=game.Players:GetPlayerFromCharacter(char)
	if not lastPunch[player] then
		lastPunch[player]=os.clock()
	end

	local passedtime=os.clock()-lastPunch[player]

	if passedtime>2 then
		char:SetAttribute("Combo",1)
	else
		if combo<maxCombo then
			char:SetAttribute("Combo",combo+1)	
		else
			char:SetAttribute("Combo",1)	
		end
	end
	lastPunch[player]=os.clock()
end



combatEvent.OnServerEvent:Connect(function(player)
	local character=player.Character
	if character:GetAttribute("HoldingSword")==false then
		return
	end
	local humanoid=character.Humanoid
	local humanoidRootPart=character.HumanoidRootPart
	local animator=humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator",humanoid)

	local attaking=character:GetAttribute("Attacking")
	local stunned=character:GetAttribute("Stunned")
	local debounce=character:GetAttribute("ComboDebounce")

	if stunned or attaking or debounce then
		return
	end

	local hitbox=HitboxService:CreateHitbox()
	hitbox.Size=Vector3.new(7, 1, 6)
	hitbox.CFrame=humanoidRootPart
	hitbox.Offset=CFrame.new(0,0,-5)
	hitbox.AutoDestroy = false

	character:SetAttribute("Attacking",true)
	character:SetAttribute("ComboDebounce",true)

	local playAnimation=getAnimation(character,"Combo")

	changeCombo(character)
	SlowingService.Slow(humanoid,playAnimation.Length+0.5,8,5)

	hitbox.Touched:Connect(function(hit,Enemy)
		if Enemy then		
			if Enemy~=humanoid and Enemy:IsA("Humanoid") then
				playSound("SwordSlice",humanoidRootPart)
				SlowingService.Slow(Enemy,playAnimation.Length,10,5)
				Enemy:TakeDamage(5)
			end
		end

	end)

	playAnimation.KeyframeReached:Connect(function(keyframe)
		if keyframe=="Hit" then
			task.spawn(function()
				playSound("SwordSwing",humanoidRootPart)
				hitbox:Start()
				task.wait(0.1)
				hitbox:Destroy()
			end)
			task.wait(playAnimation.Length-0.3)
			character:SetAttribute("Attacking",false)	

			if character:GetAttribute("Combo")==maxCombo then
				task.wait(2)
			end
		end
		character:SetAttribute("ComboDebounce",false)
	end)

	playAnimation:play()

end)

Try this maybe.

The general issue is that hitbox for some reason doesn’t exist at all. Try printing it.

1 Like