Spawn Entity on Map Start.

Sorry to bother you again. But you are my last hope.

Currently, I have an entity which needs to be spawned into the map upon it starting.
I have tried multiple methods from here, from the wiki and even from my own knowledge…

My entity islocated in the entities folder of my gamemode.
The current code I have (that does not work) is this:
local function SpawnEntities()
if SERVER then
local capC = ents.Create(“Capturezone_Combine”)
capC:SetPos(Vector(-2742, 3118, 231))
hook.Add( “InitPostEntity”, “SpawnEntities”, SpawnEntities)

This has been placed in both the Init.lua and shared.lua files of my gamemode.
If I can get ANY help at all, I will be forever thankful.

EDIT:/// The Gamemode’s derive is Sandbox. If that is any help.

You may also need to call Activate( ); after Spawn( );.

Code looks right. InitPostEntity is the correct place to spawn entities on the map.

Thank’s for the advice. Sadly it did not work.

Provide the code for “Capturezone_Combine”. The entity may be incorrectly set-up.

  • SNIP -

I am the biggest idiot in the world. Early on in the creation, I made the map clean itself on round start. Removing the capture point.

Thank’s for your help anyways.

Sorry to bother you :stuck_out_tongue: