• Can someone explain the code here?
    4 replies, posted
[lua] local function Init_TriggerLogic() if SERVER then for _, ent in ipairs( ents.FindByName( "logic_map_start" ) ) do if ( ent:GetClass() == "logic_relay" ) then ent:Fire( "trigger", 0, 0 ) end end end end hook.Add( "InitPostEntity", "MapStartTrigger", Init_TriggerLogic )[/lua] I'm really confused, I'm thinking i need to make a file called "logic_map_start.lua" in the gamemode folder and put the SNPC functions in there.
InitPostEntity is a hook that calls its functions after all the entities are initialized. It goes through all of the logic entities with a name of logic_map_start, and if that entity has a class of logic_relay then it is manually triggered through Lua.
damnit...wrong code, im looking for the base code to place a entity such as my billy mays model i downloaded in the Rp_evocity_2d map. So they could be used such as a store, like in perp.
For that you will need to make a SNPC (It's just like a SENT). Once it's done you can use ents.Create in this hook to spawn it once the map is loaded. And to answer your 4 duplicate threads you can use :Use() or :AcceptInput() to register uses of the Npc. To link it to a derma menu send an usermessage to the client and hook it to your menu clientside.
[QUOTE=Crazy Quebec;20931040]For that you will need to make a SNPC (It's just like a SENT). Once it's done you can use ents.Create in this hook to spawn it once the map is loaded. And to answer your 4 duplicate threads you can use :Use() or :AcceptInput() to register uses of the Npc. To link it to a derma menu send an usermessage to the client and hook it to your menu clientside.[/QUOTE] lol, alright thanks, now off to find out how to place a snpc.
Sorry, you need to Log In to post a reply to this thread.