Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pi=math.pi
- sin=math.sin
- cos=math.cos
- tan=math.tan
- log=math.log
- local abs=math.abs
- local pi=math.pi
- local sin=math.sin
- local cos=math.cos
- local tan=math.tan
- Msg"[Plot] "print("Initating plotter!")
- local origin= Vector(-2115.3698730469,3043.1638183594,-15500)
- local timesx,timesy=15,15
- local function BadNumber(v)
- return !v or v==inf or v==ninf or !(v>=0 or v<=0)
- end
- local mdl="models/Combine_Helicopter/helicopter_bomb01.mdl"
- PLOTENTS=PLOTENTS or {}
- local PLOTENTS=PLOTENTS
- local range=100
- local createmdl=function()
- local ent=SERVER and ents.Create('prop_physics') or ClientsideModel(mdl)
- ent:SetMaterial[[models/debug/debugwhite]]
- if !ValidEntity(ent) then error"entity limit reched?" end
- table.insert(PLOTENTS,ent)
- ent:SetPos(origin)
- ent:SetModelScale(Vector(5,5,5))
- end
- function KillPlot()
- timer.Remove"1"
- for k,v in pairs(PLOTENTS) do
- if ValidEntity(v) then
- v:Remove()
- end
- end
- table.Empty(PLOTENTS)
- --Msg"[Plot]"print("Killed.")
- end
- KillPlot()
- Msg"[Plot] "print("Creating "..timesx*timesy.." entities.")
- for i=0,timesx*timesy do
- createmdl()
- end
- if !PLOT then
- function PLOT(x,y,t) return x,sin(y)*5*(0.2+0.8*abs(sin(x/2+t))),cos(y)*5*(0.2+0.8*abs(sin(x/2+t))) end
- end
- local i=0
- local range=180
- local c=FrameTime()
- local mdltopos=function(x,y,z)
- x = math.Clamp(x,- 10 , 10 )
- y = math.Clamp(y,- 10 , 10 )
- z = math.Clamp(z,- 10 , 10 )
- if math. BadNumber(x) or math. BadNumber(y) or math. BadNumber(z) then return end
- i=i+1
- local ent=PLOTENTS[i]
- if !ent then i=0 end
- local ent=PLOTENTS[i]
- if ValidEntity(ent) then
- local vec=Vector(x,y,z)*range
- vec:Rotate(Angle(0,CurTime()*10-c,0))
- ent:SetPos(origin+vec)
- ent:SetAngles((vec-origin):Angle())
- local a=127+126*sin(z*0.2)
- --MsgN(z)
- end
- end
- if !origin then error"no origin" end
- local ft=0
- timer.Create('1',0,0,function()
- ft=ft+FrameTime()
- for x=0,timesx do
- for y=0,timesy do
- local xx = (x/timesx) * pi*2
- local yy = (y/timesy) * pi*2
- local a,zz,xxx,yyy=pcall(PLOT,xx,yy,ft)
- if !a then zz=0 end
- xx=xxx or xx
- yy=yyy or yy
- mdltopos(xx,yy,zz)--xx,yy,zz)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment