LUA Errors won't stop!!!

I have a problem… sigh … I can’t get this to work without lua errors.

AddCSLuaFile( "shared.lua" )include( 'shared.lua' )

/*---------------------------------------------------------   Name: Initialize---------------------------------------------------------*/function ENT:Initialize()
	-- Use the doll model	self.Entity:SetModel( "models/props_c17/doll01.mdl" )	self.Entity:SetMoveType( MOVETYPE_FLYGRAVITY );	self.Entity:SetMoveCollide( MOVECOLLIDE_FLY_CUSTOM );	self.Entity:SetGravity( 0.5 );
	-- Use the model's physics	self.Entity:PhysicsInitSphere(7, metal);	self.CrTime = curtime();	self.LifeLeft = 1;	-- Wake the physics object up. It's time to have babies!	local phys = self.Entity:GetPhysicsObject();	if (phys:IsValid()) then		phys:Wake()	end
end
--[[--------------------------------------------------------------------------------- Purpose:-- Input  : *pOther --------------------------------------------------------------------------------function ENT:Touch( pOther )
	local	tr;	tr = {}	tr.startpos = self.Entity:NearestPoint( pOther:OBBCenter() );	tr.endpos = pOther:NearestPoint( self.Entity:OBBCenter() );	tr.filter = self.Entity;	tr = util.TraceLine( tr );	local	vecNormalizedVel = self.Entity:GetVelocity();
	vecNormalizedVel = VectorNormalize( vecNormalizedVel );
	if( self.Entity:GetOwner() && self.Entity:GetOwner():IsPlayer() ) then		local	dmgInfo = DamageInfo();		dmgInfo:SetInflictor( self.Entity );		dmgInfo:SetAttacker( self.Entity:GetOwner() );		dmgInfo:SetDamage( 25 );		dmgInfo:SetDamageType( DMG_BURN | DMG_PREVENT_PHYSICS_FORCE );		dmgInfo:SetDamagePosition( tr.HitPos );		pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );		pOther:Ignite(3, 0)	else		local	dmgInfo = DamageInfo();		dmgInfo:SetInflictor( self.Entity );		dmgInfo:SetAttacker( self.Entity:GetOwner() );		dmgInfo:SetDamage( 0 );		dmgInfo:SetDamageType( DMG_BURN | DMG_PREVENT_PHYSICS_FORCE );		dmgInfo:SetDamagePosition( tr.HitPos );		pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );		pOther:Ignite(30, 0)		timer.Simple(30, pOther.Extinguish() )	end
	self.Entity:Remove();
	-- play body "thwack" sound--	self.Entity:EmitSound( "Weapon_Crossbow.BoltHitBody" );	-- Fireballs don't thwack.
	local vForward;
	vForward = self.Entity:GetUp();	vForward = VectorNormalize ( vForward );
	self.Touch = function( ... ) return end;	self.Think = function( ... ) return end;
	local Pos1 = tr.HitPos + tr.HitNormal	local Pos2 = tr.HitPos - tr.HitNormal--	util.Decal( "Blood", Pos1, Pos2 )	-- Scorch!
end]]
/*---------------------------------------------------------   Name: PhysicsCollide---------------------------------------------------------*/function ENT:PhysicsCollide( data, physobj )
	-- Shoot some blood--	local effectdata = EffectData();--	effectdata:SetOrigin( self.Entity:GetPos() );--	util.Effect( "BloodImpact", effectdata );
	local Pos1 = data.HitPos + data.HitNormal	local Pos2 = data.HitPos - data.HitNormal		if( self.Entity:GetOwner() && self.Entity:GetOwner():IsPlayer() ) then		local	dmgInfo = DamageInfo();		dmgInfo:SetInflictor( self.Entity );		dmgInfo:SetAttacker( self.Entity:GetOwner() );		dmgInfo:SetDamage( 25 );		dmgInfo:SetDamageType(bit.bor(DMG_BURN , DMG_PREVENT_PHYSICS_FORCE ));		dmgInfo:SetDamagePosition( tr.HitPos );		pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );		pOther:Ignite(3, 0)	-- Ignite for a little while, will do no noticable damage.	else		local	dmgInfo = DamageInfo();		dmgInfo:SetInflictor( self.Entity );		dmgInfo:SetAttacker( self.Entity:GetOwner() );		dmgInfo:SetDamage( 0 );		dmgInfo:SetDamageType(bit.bor(DMG_BURN , DMG_PREVENT_PHYSICS_FORCE ));		dmgInfo:SetDamagePosition( tr.HitPos );		pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );		pOther:Ignite(30, 0)		timer.Simple(30, pOther.Extinguish() )	end	--	util.Decal( "Blood", Pos1, Pos2 )	-- Scorch
	-- Play sound on death--[[	if (data.Speed > 80 && data.DeltaTime > 0.2 ) then		self.Entity:EmitSound( "Weapon_Crossbow.BoltHitBody" );	end]]
	SafeRemoveEntityDelayed( self.Entity, 0.1 );
end
function ENT:Think()	self.LifeLeft = 3-self.CrTime	if self.LifeLeft <= 0 then self:Remove() endend
/*---------------------------------------------------------   Name: OnTakeDamage---------------------------------------------------------*/function ENT:OnTakeDamage( dmginfo )
	-- React physically when shot/getting blown	self.Entity:TakePhysicsDamage( dmginfo )
end





Ignore the comments. They can’t be the error, unless I need to remove them…


[ERROR] lua/entities/mariofire/init.lua:18: unexpected symbol near '.'
  1. unknown - lua/entities/mariofire/init.lua:0

So post them.


[ERROR] lua/entities/mariofire/init.lua:18: unexpected symbol near '.'
  1. unknown - lua/entities/mariofire/init.lua:0


    local self.CrTime = curtime();
    local self.LifeLeft = 1;


to



    self.CrTime = CurTime();
    self.LifeLeft = 1;


you also have a few more errors in there

Yeah, if that removes it, I’ll thank you. Otherwise, I will troll you. Just curious, however… What other errors? I used the AK47 Baby Shooter to try and fix it…


[ERROR] lua/entities/mariofire/init.lua:104: ')' expected near '|'  1. unknown - lua/entities/mariofire/init.lua:0


[LUA]dmgInfo:SetDamageType( DMG_BURN | DMG_PREVENT_PHYSICS_FORCE );[/LUA]

to

[LUA]dmgInfo:SetDamageType(bit.bor(DMG_BURN , DMG_PREVENT_PHYSICS_FORCE ));[/LUA]

Thank you for that. Checking for more errors…


[ERROR] lua/entities/mariofire/init.lua:18: attempt to call global 'curtime' (a nil value)  1. unknown - lua/entities/mariofire/init.lua:18
   2. Spawn - [C]:-1
    3. unknown - lua/weapons/mario_fireballs/shared.lua:77

I have yet to investigate, though. I will update the code above.

Sigh It keeps shortening it to have no enters…


AddCSLuaFile( "shared.lua" )include( 'shared.lua' )




/*---------------------------------------------------------
   Name: Initialize
---------------------------------------------------------*/
function ENT:Initialize()


    -- Use the doll model
    self.Entity:SetModel( "models/props_c17/doll01.mdl" )
    self.Entity:SetMoveType( MOVETYPE_FLYGRAVITY );
    self.Entity:SetMoveCollide( MOVECOLLIDE_FLY_CUSTOM );
    self.Entity:SetGravity( 0.5 );


    -- Use the model's physics
    self.Entity:PhysicsInitSphere(7, metal);
    self.CrTime = curtime();
    self.LifeLeft = 1;
    -- Wake the physics object up. It's time to have babies!
    local phys = self.Entity:GetPhysicsObject();
    if (phys:IsValid()) then
        phys:Wake()
    end


end


--[[
-------------------------------------------------------------------------------
-- Purpose:
-- Input  : *pOther -
-------------------------------------------------------------------------------
function ENT:Touch( pOther )


    local    tr;
    tr = {}
    tr.startpos = self.Entity:NearestPoint( pOther:OBBCenter() );
    tr.endpos = pOther:NearestPoint( self.Entity:OBBCenter() );
    tr.filter = self.Entity;
    tr = util.TraceLine( tr );
    local    vecNormalizedVel = self.Entity:GetVelocity();


    vecNormalizedVel = VectorNormalize( vecNormalizedVel );


    if( self.Entity:GetOwner() && self.Entity:GetOwner():IsPlayer() ) then
        local    dmgInfo = DamageInfo();
        dmgInfo:SetInflictor( self.Entity );
        dmgInfo:SetAttacker( self.Entity:GetOwner() );
        dmgInfo:SetDamage( 25 );
        dmgInfo:SetDamageType( DMG_BURN | DMG_PREVENT_PHYSICS_FORCE );
        dmgInfo:SetDamagePosition( tr.HitPos );
        pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );
        pOther:Ignite(3, 0)
    else
        local    dmgInfo = DamageInfo();
        dmgInfo:SetInflictor( self.Entity );
        dmgInfo:SetAttacker( self.Entity:GetOwner() );
        dmgInfo:SetDamage( 0 );
        dmgInfo:SetDamageType( DMG_BURN | DMG_PREVENT_PHYSICS_FORCE );
        dmgInfo:SetDamagePosition( tr.HitPos );
        pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );
        pOther:Ignite(30, 0)
        timer.Simple(30, pOther.Extinguish() )
    end


    self.Entity:Remove();


    -- play body "thwack" sound
--    self.Entity:EmitSound( "Weapon_Crossbow.BoltHitBody" );    -- Fireballs don't thwack.


    local vForward;


    vForward = self.Entity:GetUp();
    vForward = VectorNormalize ( vForward );


    self.Touch = function( ... ) return end;
    self.Think = function( ... ) return end;


    local Pos1 = tr.HitPos + tr.HitNormal
    local Pos2 = tr.HitPos - tr.HitNormal
--    util.Decal( "Blood", Pos1, Pos2 )    -- Scorch!


end
]]


/*---------------------------------------------------------
   Name: PhysicsCollide
---------------------------------------------------------*/
function ENT:PhysicsCollide( data, physobj )


    -- Shoot some blood
--    local effectdata = EffectData();
--    effectdata:SetOrigin( self.Entity:GetPos() );
--    util.Effect( "BloodImpact", effectdata );


    local Pos1 = data.HitPos + data.HitNormal
    local Pos2 = data.HitPos - data.HitNormal
    
    if( self.Entity:GetOwner() && self.Entity:GetOwner():IsPlayer() ) then
        local    dmgInfo = DamageInfo();
        dmgInfo:SetInflictor( self.Entity );
        dmgInfo:SetAttacker( self.Entity:GetOwner() );
        dmgInfo:SetDamage( 25 );
        dmgInfo:SetDamageType(bit.bor(DMG_BURN , DMG_PREVENT_PHYSICS_FORCE ));
        dmgInfo:SetDamagePosition( tr.HitPos );
        pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );
        pOther:Ignite(3, 0)    -- Ignite for a little while, will do no noticable damage.
    else
        local    dmgInfo = DamageInfo();
        dmgInfo:SetInflictor( self.Entity );
        dmgInfo:SetAttacker( self.Entity:GetOwner() );
        dmgInfo:SetDamage( 0 );
        dmgInfo:SetDamageType(bit.bor(DMG_BURN , DMG_PREVENT_PHYSICS_FORCE ));
        dmgInfo:SetDamagePosition( tr.HitPos );
        pOther:DispatchTraceAttack( dmgInfo, vecNormalizedVel, tr.HitPos );
        pOther:Ignite(30, 0)
        timer.Simple(30, pOther.Extinguish() )
    end
    
--    util.Decal( "Blood", Pos1, Pos2 )    -- Scorch


    -- Play sound on death
--[[    if (data.Speed > 80 && data.DeltaTime > 0.2 ) then
        self.Entity:EmitSound( "Weapon_Crossbow.BoltHitBody" );
    end]]


    SafeRemoveEntityDelayed( self.Entity, 0.1 );


end


function ENT:Think()
    self.LifeLeft = 3-self.CrTime
    if self.LifeLeft <= 0 then self:Remove() end
end


/*---------------------------------------------------------
   Name: OnTakeDamage
---------------------------------------------------------*/
function ENT:OnTakeDamage( dmginfo )


    -- React physically when shot/getting blown
    self.Entity:TakePhysicsDamage( dmginfo )


end










Touch has been un-commented. It wasn’t doing damage, but that’s likely because of the new error.


[ERROR] lua/entities/mariofire/init.lua:50: ')' expected near '|'  1. unknown - lua/entities/mariofire/init.lua:0


[lua]dmgInfo:SetDamageType( DMG_BURN | DMG_PREVENT_PHYSICS_FORCE );[/lua]
to
[lua]dmgInfo:SetDamageType( bit.bor( DMG_BURN, DMG_PREVENT_PHYSICS_FORCE ) )[/lua]
In function ENT:Touch( pOther )