How I make my DrGBase SNPCs! - Part 2: General Functions And Such.

Subscribers:
18,500
Published on ● Video Link: https://www.youtube.com/watch?v=lcxFSYP8_r8



Duration: 12:17
1,023 views
29


function ENT:TeleportSpos()
if self:GetEnemy():IsValid() then
local right = math.random(-1000,1000)
local left = math.random(-1000,1000)
if math.random(1,100) == 25 then
local pos = self:GetEnemy():GetPos()
self:SetPos(pos + Vector(left,right,100))
end
end
end
function ENT:Changesky()
self.Sky = ents.Create("edit_sky")
self.Sky:SetPos(self:GetPos())
self.Sky:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
self.Sky:SetTopColor( Vector(255 ,0, 0) )
self.Sky:SetHDRScale(1)
self.Sky:SetBottomColor( Vector(255.0, 0.0, 0.0) )
self.Sky:SetDuskColor( Vector(255,0,0) )
self.Sky:SetSunSize( 0 )
self.Sky:SetSolid(SOLID_NONE)
self.Sky:SetStarTexture( "skybox/starfield" )
self.Sky:SetStarSpeed( 2.00 )
self.Sky:SetParent(self)
self.Sky:SetOwner(self)
self.Sky:SetNoDraw(true)
self.Sky:Spawn()
end
function ENT:AddFog()
self.Fog = ents.Create("edit_fog")
self.Fog:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
self.Fog:SetPos(self:GetPos() +self:GetForward()*math.random(-200,200))
self.Fog:SetFogStart( 0 )
self.Fog:SetFogEnd( 500 )
self.Fog:SetDensity( 2 )
self.Fog:SetNoDraw(true)
self.Fog:SetSolid(SOLID_NONE)
self.Fog:SetFogColor( Vector( 2.0, 0.00, 0.00 ) )

self.Fog:SetParent(self)
RunConsoleCommand("pp_mat_overlay", "effects/water_warp01")
self.Fog:SetOwner(self)
self.Fog:Spawn()
self.Fog:Activate()
end
function ENT:Summon()
local ent = ents.Create("npc_drg_tutorial")
ent:SetPos(self:GetPos())
ent:SetAngles(self:GetAngles(300,-50,0))
ent:Spawn()
local pos1 = self:LocalToWorld(Vector(300,0,0))
end
self:TeleportSpos()
end
end
end
self:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE)

https://steamcommunity.com/sharedfiles/filedetails/?id=170589737