So, I have a gun script, I'm getting the error "No method name passed in __namecall for Object" I don't know why this is occurring, but I'll give you the portion of the code that's causing the error.

The error's coming from line 91, which is line 22 in the code segment. "fireBulletEvent(variables)"

function fireBullet()
	--Gunfire animation
	animTrack:Stop()
	local character = player.Character
	local Humanoid = character.Humanoid
	animTrack = character.Humanoid:LoadAnimation(fireGun)
	animTrack:Play()
	local mouse = player:GetMouse()	
	
	local variables = {
		tool;
		bulletCount;
		spread;
		bulletSize;
		hitmarker;
		destroyHead;
		damage;
		mouse;
		mouseIcon;
	}	
	
	fireBulletEvent(variables)	
	
	wait(0.25)
	
	animTrack:Stop()
	animTrack = character.Humanoid:LoadAnimation(holdGun)
	animTrack:Play()	

end

1 comment

0

__namecall fires when you use the ":" operator. If fireBulletEvent is a RemoteObject - read up on how to properly fire its listener functions at (http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions)