Custom NPC works in singeplayer, completely breaks when put on server.

So I have completed the hardest parts of my NPC, took a while, got a lot of help, but I was so hyped to put it in the server, until I spawned it, and this monstrosity you will see later came out. Any advice on how to fix this will again, be very appreciated.

init.lua


AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")

include("shared.lua")

function ENT:Initialize()
	self:SetModel("models/npc/bf2_reg/91st/bf291.mdl")
	self:SetHullType( HULL_HUMAN );
	self:SetHullSizeNormal();
	self:SetSolid( SOLID_BBOX ) 
	self:SetMoveType( MOVETYPE_STEP )
	self:CapabilitiesAdd(CAP_TURN_HEAD + CAP_ANIMATEDFACE)
	self:SetHullType(HULL_HUMAN)
	self:SetHullSizeNormal()
	self:SetUseType( SIMPLE_USE )
	self:SetMaxYawSpeed(5000)
end
util.AddNetworkString("OpenMenu")
util.AddNetworkString("BuyDelta")

function ENT:AcceptInput(input, activator, caller)
	if input == "Use" and activator:IsPlayer() then
		net.Start("OpenMenu")
		net.Send(caller) 
	end
end

net.Receive("BuyDelta", function(len, ply)
	entity = ents.Create("delta-7")
	entity:SetPos(ply:EyePos() + ply:GetAngles():Right() * 200 + Vector(10, 0, 10))				
	entity:Spawn()
		timer.Simple( .25, function() 	
			PrintMessage(HUD_PRINTTALK, "Your ship has been delivered.")
	end)
	end)

cl_init.lua


include("shared.lua")

ENT.RenderGroup = RENDERGROUP_BOTH


surface.CreateFont( "Shop Title", {

    font = "coolvetica",

    size = 55,

    weight = 1000,

    antialias = true,

} )

surface.CreateFont( "DLabel", {

    font = "coolvetica",

    size = 30,

    weight = 1000,

    antialias = true,

} )

surface.CreateFont( "DButton", {

    font = "coolvetica",

    size = 25,

    weight = 1000,

    antialias = true,

} )

surface.CreateFont( "Price", {

    font = "coolvetica",

    size = 25,

    weight = 1000,

    antialias = true,

} )


net.Receive("OpenMenu", function() 
    local frame = vgui.Create("DFrame") 
    frame:SetSize(ScrW()/2, ScrH()/2) 
    frame:Center()
    frame:MakePopup() 
    frame:SetTitle("")


        function frame:Paint( w, h )
            draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0 ) )
            draw.RoundedBox(0,5,5,w-10,h-10,Color(111,111,111))
        end


    local text = vgui.Create("DLabel", frame)
    text:SetText("Hey there, so you wanna try your hand at piloting? Go ahead.")

    text:SetPos(125, 5)
    text:SetFont("DLabel")
    text:SetColor(Color(255, 144, 0))
    text:SetSize(1000, 30)
    
    local text2 = vgui.Create("DLabel", frame)
    text2:SetText("Here is a list of ships you can buy.")
    text2:SetPos(300, 40)
    text2:SetFont("DLabel")
    text2:SetColor(Color(255, 144, 0))
    text2:SetSize(1000, 30)



         local rgb = Color

        local DScrollPanel = vgui.Create( "DScrollPanel", frame ) 
        DScrollPanel:SetSize( 565, 300 )
        DScrollPanel:SetPos( 5, 500 ) 
        DScrollPanel:Dock( FILL )
        DScrollPanel:Center()

        local sbar = DScrollPanel:GetVBar()
        function sbar:Paint( w, h )
            draw.RoundedBox( 0, 0, 0, w, h, rgb(52, 73, 94,100) )
        end
        function sbar.btnUp:Paint( w, h )
            draw.RoundedBox( 0, 0, 0, w, h, rgb(192, 57, 43) )
        end
        function sbar.btnDown:Paint( w, h )
            draw.RoundedBox( 0, 0, 0, w, h, rgb(192, 57, 43) )
        end
        function sbar.btnGrip:Paint( w, h )
            draw.RoundedBox( 0, 0, 0, w, h, rgb(44, 62, 80) )
        end

        local button = vgui.Create("DButton", frame)
            button:SetSize(200,150)   
            button:SetPos(15, 80)
            button:SetText("Buy a V-Wing")
            button:SetFont("DButton")
            button.DoClick = function() 
                    net.Start("BuyDelta")
                    net.SendToServer()
                    frame:Close()
            end


        local text2 = vgui.Create("DLabel", frame)
            text2:SetText("Cost: $250")
            text2:SetPos(60, 170)
            text2:SetFont("Price")
            text2:SetColor(Color(255, 144, 0))
            text2:SetSize(1000, 30)
end)


hook.Add("PostDrawOpaqueRenderables", "NpcTitle", function()
    for _, ent in pairs (ents.FindByClass("testnpc")) do
        if ent:GetPos():Distance(LocalPlayer():GetPos()) < 800 then
            local plyAng = LocalPlayer():GetAngles()
            local ang = Angle(0, plyAng.y - 180, 0)

            ang:RotateAroundAxis(ang:Forward(), 90)
            ang:RotateAroundAxis(ang:Right(), -90)

            cam.Start3D2D(ent:GetPos() + ent:GetForward() + ent:GetUp() * 85, ang, 0.1)
                draw.RoundedBox(4, -155, -22, 310, 55, Color(10, 10, 10, 150))
                
                draw.SimpleText( "Ship Merchant", "Shop Title", 0, -25, Color(0, 139, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
            cam.End3D2D()
        end
    end
end)

shared.lua


ENT.Type = "ai"
ENT.Base = "base_ai"

ENT.PrintName = " Dark's NPC "
ENT.Instructions = "Ship Merchant, Special thanks to -ICE- to not only helping me, but for being such a legend in the process."
ENT.Category = "Dark's Custom Remnant Entities"

ENT.Spawnable = true
ENT.AdminSpawnable = true

The entity looks like this:

as well as the menu, when the button is clicked, closes, but no ship is spawned. (Also I know money isn’t added yet and that is purposeful)

The directory for the entity in the server entities file is here:
(IP, not showing)/garrysmod/addons/darkrpmodification/lua/entities/testnpc
Thanks

so, whats wrong with it exactly?
and what do you mean by “working in singleplayer”?

So, in singeplayer where I tested it when I was coding it, everything worked how I wanted it to, you press E on it, the derma frame opens, you click the button, it spawns a V-Wing (Ship/entity)

But when I put it in the server files, and went in the multiplayer server, the NPC then spawned in looking like the picture I linked, and when you press E on it, the menu opens, but nothing happens except the menu closing when you press the button.

does the entity you’re trying to spawn exist on the server?
check your server log for any errors thrown.

for the “npc spawns looking like the picture”, i’m making a wild guess and assumption here because you still haven’t stated whats wrong with it but i think you’re referring to its pose.
Try giving it an animation: https://wiki.garrysmod.com/page/NextBot/StartActivity such as ACT_IDLE

– edit –
just noticed you’re not using nextbot.
i think this means you’ll have to resort to using sequences instead.

I’ll try the act_idle, but I can’t test it rn, my friend hasn’t given me console access yet so I can’t do a restart. But I am sure it does exists as its listed in the entities folder within darkrpmodification (Where all my other working entities are) but no errors are thrown. It shows in the Q menu under entities and my custom tab, but when I spawn it, no errors are thrown, and it does the pose and the menu bug.

And yeah, I meant the pose, since that’s the most obvious thing that shouldn’t be there.