• ENT:Use()
    3 replies, posted
Hello, I'm trying my hand at making a simple snpc that can be used. Right now ENT:Use() doesn't appear to get called, any ideas why? [lua]AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include('shared.lua') function ENT:Initialize() self.Entity:SetModel( "models/alyx.mdl" ) self.Entity:SetHullSizeNormal() self.Entity:SetHullType( HULL_HUMAN ) self.Entity:SetSolid( SOLID_BBOX ) self.Entity:SetMoveType( MOVETYPE_STEP ) self.Entity:SetHealth( 100000 ) self.Entity:SetUseType( SIMPLE_USE ) self.Entity:DropToFloor() end function ENT:OnTakeDamage() return false end function ENT:Use( activator, caller ) print( activator, caller ) activator:ChatPrint("Quit it!") end[/lua]
[lua]function ENT:AcceptInput( Name, Activator, Caller ) if( Name == "Use" ) then Activator:ChatPrint( "Quit it!" ); end end[/lua]
Oh, thanks. :)
No problem.
Sorry, you need to Log In to post a reply to this thread.