• Can not do sequence to entity
    6 replies, posted
Hi, I can not set the sequence to entity cl_init.lua include('shared.lua') function ENT:Draw() self:DrawModel() end init.lua AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" )   include('shared.lua')   function ENT:Initialize() self:SetModel( "models/tnb/citizens/male_09.mdl" ) self:SetHullType( HULL_HUMAN ) self:SetHullSizeNormal() self:SetNPCState( NPC_STATE_SCRIPT ) self:SetSolid( SOLID_BBOX ) self:CapabilitiesAdd( bit.bor( CAP_ANIMATEDFACE, CAP_TURN_HEAD ) ) self:SetUseType( SIMPLE_USE ) self:DropToFloor() local sequence = self:LookupSequence("injured3")  self:SetSequence(sequence) end function ENT:Think() self:NextThink( CurTime() ) return true end shared.lua ENT.Type = "ai" ENT.Base = "base_ai"   ENT.PrintName = "Animated1" ENT.Category = "NPC" ENT.Author = "Example" ENT.Spawnable = true ENT.AutomaticFrameAdvance = true
I recreated this entity with models/humans/group01/male_09.mdl and it looks like you're setting the sequence too early. I could trigger sequences manually after the entity had be spawned.
I tried to use with this model and it instantly change back GIF: https://files.facepunch.com/forum/upload/303163/cef9f380-36f5-4d87-aab6-64205cd756a4/2018-07-29_01-48-25.gif function ENT:AcceptInput( ) local sequence = self:LookupSequence("injured3")  self:SetSequence(sequence) end
Try checking the SequenceDuration of the sequence you've set, it's probably short for that model.
But how I can do not looping animation, just play and stop
That really depends on what you're looking for. What do you want the entity to do?
I want to do npc, which is sitting
Sorry, you need to Log In to post a reply to this thread.