Me again,
just created a test entity, and it's Use Function never gets called
init.lua
[LUA]
AddCSLuaFile( 'cl_init.lua' )
AddCSLuaFile( 'shared.lua' )
include( 'shared.lua' )
//Initialize
function ENT:Initialize()
//self.BaseClass.Initialize(self)
self:SetModel( Model("models/weapons/w_slam.mdl") )
self:SetSolid(SOLID_BBOX);
self:PhysicsInit(SOLID_BBOX);
self:SetMoveType(MOVETYPE_STEP);
self:DrawShadow(true);
self:SetUseType(SIMPLE_USE);
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
print("called") --called
end
function ENT:Use( activator, caller )
Msg("TEEEST") --not called
end
function ENT:AcceptInput( name )
Msg("called12431232113") --not called
end
[/LUA]
shared.lua
[LUA]
ENT.Type = "anim";
ENT.PrintName = "ttt_test" //Ents name.
ENT.Author = "Johnny"
ENT.Contact = "Don't"
ENT.Purpose = "Base Entity" //What the ents purpose is.
ENT.Spawnable = false //Spawnable by anyone.
ENT.AdminSpawnable = false //spawnable by admins.
[/LUA]
cl_init.lua
[LUA]
include("shared.lua")
local laser = Material( "cable/redlaser" )
function ENT:Initialize()
end
function ENT:Draw()
self:DrawModel()
end
function ENT:OnRemove()
end
[/LUA]
If you need more Information, just say it
Sorry, you need to Log In to post a reply to this thread.