• Perma NPC State
    1 replies, posted
Hello, I hope you can help me. I tried to create an NPC. It works very well but only problem: I can not get him to take a posture other than a ragdoll posture. I do not know where it comes from and I do not know how to initialize an NPC to do spawn with an already configured posture. I saw on the Gmod Wiki that there was a command that looked like what I was looking for: [url]https://wiki.garrysmod.com/page/Enums/ACT[/url] I tried inserting it in the function ENT: Initialize but it does not work ... There are still no ragdoll positions whatever I do ... Has anyone got an idea? thank you in advance It is my init file : [CODE] resource.AddFile("addons/Spatioport_Ingénieurs/sound/Calorc.mp3") AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include('shared.lua') function ENT:Initialize() self:SetModel("models/player/hydro/swbf_imperial_officer_nco/swbf_imperial_officer_nco.mdl") self:SetHullType(HULL_HUMAN) self:SetHullSizeNormal() self:SetNPCState(NPC_STATE_NONE) self:SetSolid(SOLID_BBOX) self:CapabilitiesAdd(CAP_ANIMATEDFACE) self:SetUseType(SIMPLE_USE) self:DropToFloor() self:SetMaxYawSpeed(90) self:SelectWeightedSequence( 64) end function ENT:OnTakeDamage() return false end util.AddNetworkString( "Calorc Syrma" ) --< Nom de la fonction ce trouvant dans le CL_INIT function ENT:AcceptInput( Name, Activator, Caller ) if Name == "Use" and Caller:IsPlayer() then Activator:PrintMessage(HUD_PRINTTALK, "Calorc : Laissez moi tranquille! Vous voyez pas que j'travaille ! Occupez vous de vos affaires!") self:EmitSound("Calorc.mp3", 100, 100, 1, 2) -- (ou .MP3) end end[/CODE] I tried to put : [CODE]self:SelectWeightedSequence( number act )[/CODE] and with and without the command [CODE]self:SetNPCState(NPC_STATE_NONE)[/CODE] but it doesn't work...
ents.Create
Sorry, you need to Log In to post a reply to this thread.