@name HoloGhost 4 @persist Scale SprMult Pod:entity V Player_Mass TickRate Anim:string User:entity RH TeleEnt:entity ObjectGrabbed InteractCooldown OPos:vector @persist Noclip NoclipCooldown @persist [DestinationC,DestinationN]:array DestinationBoth:table #@inputs CamController:wirelink function makeDestination(Str:string,Vec:vector){ DestinationC[DestinationC:count() + 1,vector] = Vec DestinationN[DestinationN:count() + 1,string] = Str DestinationBoth[Str,vector] = Vec } Ops = ops() if(dupefinished()){ reset() } if(first()){ ValidDest = 0 MapNames = map():explode("_") MapNames:shiftString() MapName = MapNames:shiftString() if(MapName == "galaxies"){ makeDestination( "shakuras", vec(-5178.704102, -5695.135742, 6895.031250)) makeDestination("hiigara", vec(9079.110352, 9640.809570, -5943.968750)) makeDestination("earth",vec(784.775085, 10460.960938, 8144.031250)) makeDestination("desert",vec(10322.076172, -12361.048828, -9215.968750)) makeDestination("moon",vec(-4550.467285, 13761.375000, 10484.055664)) makeDestination("station",vec(4963.117676, -6835.511719, 8512.031250)) makeDestination("pegasus",vec(766.279297, -9589.005859, 8849.352539)) makeDestination("universe",vec(7418.365723, -2342.522461, -10817.677734)) makeDestination("milkyway",vec(-11642.699219, 5558.858887, 8551.136719)) makeDestination("build",vec(13594.027344, 13631.071289, -16103.968750)) makeDestination("secret",vec(-218.476227, -524.861633, -15807.968750)) makeDestination("water",vec(-2.854739, 8135.880859, 8314.55273)) makeDestination("lava",vec(-11192.286133, 678.807068, -4575.968750)) makeDestination("spawn",vec(-234.982758, -0.430868, 16144.031250)) makeDestination("admin",vec( -6788, -6463, -15203)) } elseif(MapName == "bigcity"){ makeDestination( "spawn", vec(-2240.432861, -1018.251404, -11071.968750)) makeDestination("tower1",vec(2281.898682, -9516.808594, 512.031250)) makeDestination("tower2",vec(-1360.510254, -7274.635254, 512.031250)) makeDestination("helipad",vec(4637.549316, 75.033058, -8575.968750)) makeDestination("skybox",vec(-764.956177, 1675.720581, 4480.031250)) makeDestination("stormdrain",vec(10667.199219, 4846.694824, -11343.968750)) makeDestination("waste",vec(9356.726563, 9053.317383, -11199.968750)) makeDestination("hotel",vec(381.705627, 2210.856689, -9279.968750)) makeDestination("bumpy",vec(-2475.086426, 10744.399414, -11069.446289)) makeDestination("whitesquare",vec(-8942.804688, 1675.775513, -11071.968750)) makeDestination("suburbs",vec(10738.890625, -4297.989746, -11071.349609)) makeDestination("sewer",vec(6656.042480, -5711.318848, -11215.969727)) } elseif(map()=="gm_carcon_ws"){ makeDestination( "spawn",vec(96.000000, -2128.000000, -14327.36718)) makeDestination("garage1",vec(-1001.599365, -6368.566406, -14519.9687)) makeDestination("garage2",vec(-1795.912231, -6512.567383, -14519.536133)) makeDestination("garage3",vec(-3024.103760, -6667.022461, -14519.96875)) makeDestination("garage4",vec(-4049.731689, -6645.451660, -14519.968750)) makeDestination("grass",vec(-2681.813, 965, -1143.225952)) makeDestination("viewing",vec(-74.004303 -2332.887939 -14175.968750)) makeDestination("elevatortop",vec(527.368713, -5122.715332, -7999.968750)) makeDestination("elevatorbottom",vec(469.674652, -5344.316406, -14143.968750)) makeDestination("hilltop",vec(-11418.576172, -3045.502930, -11199.810547)) makeDestination("hillbottom",vec(-12727.256836, 2255.923096, -14527.968750)) } elseif(map():explode("_")[3,string] == "m"){ makeDestination( "presentation",vec(-5597.200684, 3257.039551, -15743.968750)) makeDestination("testchamber",vec(-4466.996582, 3180.366699, -15791.968750)) makeDestination("build",vec(-657.598755, 2170.452148, -13247.968750)) makeDestination("pit",vec(10835.133789, -669.686401, -15338.956055)) makeDestination("mine",vec(8707.099609, 1795.441284, -15308.104492)) makeDestination("containment",vec(8771.852539, 5277.682617, -15360.968750)) makeDestination("water",vec(8679.204102, 8480.156250, -13247.968750)) makeDestination("jail",vec(-2075.313477, 410.993317, -13235.968750)) makeDestination("heaven",vec(7434.365234, 5567.396973, 6572.58105)) makeDestination("hell",vec(7443.367676, 34.216660, 4379.332520)) makeDestination("snow",vec(-12210.021484, 8679.501953, -1755.968750)) makeDestination("spartan",vec(-2698.521240, 15291.765625, 15296.031250)) } elseif(map() == "gm_construct"){ makeDestination( "farcorner",vec(-4437.129883, 4118.559570, -39.69603)) makeDestination("tower3",vec(-4450.648438, 5297.418945, 2560.031250)) makeDestination("tower2",vec(-2351.745361, -2560.120850, 2912.031250)) makeDestination("skybox",vec(-2066.207764, 935.414917, 11081.906250)) makeDestination("spawn",vec(-665.931580, -1434.093506, -79.968750)) makeDestination("white",vec(-2005.072144, -3511.152344, -192.468750)) makeDestination("mirror",vec(-2158.973877, -1620.646606, -310.968750)) makeDestination("lambda",vec(-2999.152100, -1298.219849, -31.968750)) makeDestination("water",vec(719.951050, 4340.753906, 32.031067)) } elseif(MapName == "forlorn"){ makeDestination( "shakuras", vec(5469.985352, -7209.216797, -9111.968750)) makeDestination("earth",vec(-8324.356445, 10450.916016, 7156.031250)) makeDestination("ice",vec(4994.816406, -3530.847412, 7140.618164)) makeDestination("desert",vec(10216.252930, 10917.357422, -8777.542969)) makeDestination("station",vec(8959.536133, 9320.043945, 110.031250)) makeDestination("build",vec(13594.027344, 13631.071289, -16103.968750)) makeDestination("water",vec(-2.854739, 8135.880859, 8314.55273)) makeDestination("lava",vec(-8440.761719, -5720.912598, -6029.360840)) makeDestination("spawn",vec(33.796497, -8562.305664, 10592.031250)) makeDestination("build",vec(9935.511719, -6062.577148, -11453.968750)) makeDestination("asteroid",vec(-3638.556152, 1564.907227, -169.968750)) } elseif(map() == "gm_construct_m3_137"){ makeDestination("presentation",vec(-5597.200684, 3257.039551, -15743.968750)) makeDestination("testchamber", vec(-4466.996582, 3180.366699, -15791.968750)) makeDestination("build", vec(-657.598755, 2170.452148, -13247.968750)) makeDestination("pit", vec(10835.133789, -669.686401, -15338.956055)) makeDestination("mine", vec(8707.099609, 1795.441284, -15308.104492)) makeDestination("containment", vec(8771.852539, 5277.682617, -15360.968750)) makeDestination("water", vec(8679.204102, 8480.156250, -13247.968750)) makeDestination("jail", vec(-2075.313477, 410.993317, -13235.968750)) makeDestination("heaven", vec(7434.365234, 5567.396973, 6572.58105)) makeDestination("hell", vec(7443.367676, 34.216660, 4379.332520)) } elseif(map() == "gm_functional_flatgrass"){ makeDestination("rail_bridge", vec(133.21527099609,10866.247070313,-11081.96875)) makeDestination("spawn", vec(343.41207885742,937.45513916016,-11263.96875)) makeDestination("platform", vec(-336.96539306641,-181.32881164551,-10943.96875)) makeDestination("movingbridge1", vec(5031.619140625,-10559.525390625,-11263.96875)) makeDestination("movingbridge2", vec(7204.099609375,-10584.83984375,-11263.96875)) makeDestination("desert", vec(5865.6318359375,6070.2841796875,-11263.46484375)) makeDestination("plaza", vec(390.63790893555,-603.86450195313,-12543.96875)) makeDestination("cinema", vec(-3396.595703125,-811.68298339844,-12527.96875)) makeDestination("pool", vec(-4377.7060546875,1261.0467529297,-12543.96875)) makeDestination("carpark1", vec(-8107.6147460938,-8659.2275390625,-12031.96875)) makeDestination("projectorroom", vec(-3682.7788085938,-635.16668701172,-12175.96875)) makeDestination("garage", vec(-9531.0498046875,-5659.3217773438,-12543.96875)) makeDestination("ramps", vec(-11898.763671875,15203.543945313,-16255.96875)) makeDestination("moregarages", vec(-554.60150146484,14002.501953125,-16255.96875)) makeDestination("rocky", vec(2812.1127929688,2142.9619140625,-15359.805664063)) makeDestination("bigempty", vec(16238.013671875,-3323.1638183594,-12799.96875)) } elseif(map() == "sb_wuwgalaxy_fix"){ makeDestination("shakuras", vec(7469.4799804688,-6327.314453125,-10069.96875)) makeDestination("shakgate", vec(10114.291992188,-11825.409179688,-10124.96875)) makeDestination("shakroom", vec(8476.2275390625,-10899.626953125,-10127.96875)) makeDestination("stationgate", vec(7795.8393554688,5276.1142578125,7004.03125)) makeDestination("airlock", vec(9792.7470703125,3897.4755859375,7020.03125)) makeDestination("kobol", vec(-8809.0771484375,10824.794921875,-950.32061767578)) makeDestination("asteroidsurface", vec(-10292.317382813,-10238.129882813,-10819.96875)) makeDestination("asteroidplaza", vec(-10170.588867188,-10071.557617188,-11328.96875)) makeDestination("asteroidhangar", vec(-8879.6181640625,-10476.654296875,-11651.96875)) makeDestination("lava", vec(-6975.9497070313,-10917.6875,227.17175292969)) makeDestination("volcano", vec(1461.7116699219,8814.330078125,-10197.534179688)) makeDestination("thirdlava", vec(-8553.9296875,-3692.138671875,9846.408203125)) makeDestination("snow", vec(11611.354492188,11214.03125,12434.319335938)) makeDestination("sunorbit", vec(-10055.6875,-10763.646484375,13335.563476563)) makeDestination("sun", vec(-12148.7265625,-12971.204101563,14745.0546875)) } else{ makeDestination("Map not seeded",vec(0)) print("Not Seeded:"+map()) } } if(first()){ runOnChat(1) WalkSpeed = 4 TickRate = 50 Scale = 1 Player_Mass = 85 print(owner():model()) Pod = seatSpawn("",entity():pos(),ang(vec(0)),1) entity():parentTo(Pod) holoCreate(1) holoScale(1,vec(Scale)) holoVisible(1,players(),0) holoCreate(2) holoScale(2,vec(Scale)) holoParent(2,1) holoModel(2,owner():model()) holoAng(1,ang(vec(0))) holoModel(1,owner():model()) #CamController["Position",vector] = holoEntity(1):pos() + holoEntity(1):height() * Scale / 0.9 #CamController["Parent",entity] = holoEntity(1) cameraCreate(1,holoEntity(1):pos() + holoEntity(2):forward() * Scale+ vec(0,0,holoEntity(1):height() * Scale * 0.85),ang(vec(0))) cameraParent(1,holoEntity(1)) SprMult = 1 holoCreate(3) holoScale(3,vec(1.25)) holoVisible(3,players(),0) holoColor(3,vec4(0,255,255,100)) holoCreate(4) holoVisible(4,players(),1) holoModel(4,"icosphere") holoColor(4,vec4(0,255,0,100)) holoPos(4,holoEntity(2):attachmentPos("anim_attachment_RH")) holoParentAttachment(4,holoEntity(2),"anim_attachment_RH") holoScale(4,vec(0.75)) RH = 4 holoCreate(5) holoModel(5,"hq_cylinder") holoScale(5,vec(0.65,0.65,0.25)) holoColor(5,vec(20)) holoCreate(6) holoModel(6,"hq_cylinder") holoScale(6,vec(0.45,0.65,0.125)) holoPos(6,holoEntity(5):pos() + vec(2,0,0)) holoParent(6,5) TeleEnt = entity() } holoScale(1,vec(Scale)) holoScale(2,vec(Scale)) holoScale(4, vec(Scale) * 0.75) cameraPos(1,holoEntity(1):pos() + holoEntity(2):forward() * Scale+ vec(0,0,holoEntity(1):height() * Scale * 0.85)) interval(TickRate) User = Pod:driver() if(Pod:driver():name() == ""){User = entity()} function string getAnimation(){ if(Noclip == 0){ if(User:keyPressed("F")){ return "idle_magic" } else{ if(User:keyDuck()){ if(User:keyForward() | User:keyBack()){ return "cidle_all" } else{ return "cidle_all" } } else{ if(User:keySprint()){ return "menu_walk" } else{ if(User:keyForward() | User:keyBack()){ return "menu_walk" } else{ return "idle_all_01" } } } } } else{ return "jump_fist" } } #Camera Shizzle if(changed(User)){ if(User:name() != ""){ cameraToggle(1,1,Pod) holoModel(2,User:model()) IdNum = mod(User:steamID():sub(11):toNumber(), 360) Color = hsv2rgb(180+sin(IdNum*2)*180, 0.5+(cos(IdNum))^(1/4)/2, 1) #holoEntity(2):setText(User:name()) #holoEntity(2):setTextColor(Color) holoAnim(2,"idle_all_01") holoColor(4,Color) holoAng(5,User:attachmentAng("eyes")) holoPos(5,User:attachmentPos("eyes") + owner():eyeAngles():forward() * -2 + owner():eyeAngles():up() * -1) holoParentAttachment(4,holoEntity(2),"anim_attachment_RH") #holoSkin(1,2) timer("attachvisor",10) holoColor(6,Color) } else{ cameraToggle(1,0) holoModel(2,"models/player/infoplayerstart.mdl") if(holoEntity(2):model() == ""){ holoModel(2,"") } holoAnim(2,"idle_all_01",1,0.001) holoColor(4,vec(0)) holoEntity(5):deparent() #holoEntity(2):setTextColor(vec(255)) #holoEntity(2):setText("Empty") } } #holoEntity(2):setTextOffset(vec(0,0,holoEntity(2):height() * Scale)) holoModel(1,User:model()) cameraAng(1,User:eyeAngles()) holoVisible(2,players(),1) #holoVisible(2,User,0) if(clk("attachvisor")){ holoParentAttachment(5,User,"eyes") } #Gravity rangerFilter(players()) RangerHeight = 40 RangerZN = rangerOffset(10000000, holoEntity(1):pos() + vec(0,0,RangerHeight * Scale), -entity():up()) if(Noclip != 1){ if(RangerZN:distance() < RangerHeight * Scale - 1){ holoPos(1,RangerZN:pos()) V = 0 } elseif(RangerZN:distance() > RangerHeight * Scale + 1){ V += (gravity() * Player_Mass * Scale - V * airDensity() / 16) / 4 if(RangerZN:distance() - RangerHeight <= V / TickRate / 10){ V =0 holoPos(1,RangerZN:pos()) } holoPos(1,holoEntity(1):pos() - vec(0,0,V / TickRate / 10)) } else{V = 0} } #Controls holoAng(2,ang(vec(0,User:eyeAngles():yaw(),0))) SpeedNum = 200 #The normal walk speed of the player in units/s WalkSpeed = SpeedNum * TickRate / 1000 Divider = 1 if(User:keySprint()){ WalkSpeed = WalkSpeed * 4 Divider = 0.25 } if(User:keyWalk()){ WalkSpeed = WalkSpeed / 2 Divider = 2 } if(Noclip){ if(User:keyForward()){holoPos(1,holoEntity(1):pos() + User:eyeAngles():forward() * 4 * WalkSpeed * TickRate / 100)} elseif(User:keyBack()){holoPos(1,holoEntity(1):pos() - User:eyeAngles():forward() * 4 * WalkSpeed * TickRate / 100)} if(User:keyLeft()){holoPos(1,holoEntity(1):pos() - holoEntity(2):right() * 4 * WalkSpeed * TickRate / 100)} elseif(User:keyRight()){holoPos(1,holoEntity(1):pos() + holoEntity(2):right() * 4 * WalkSpeed * TickRate / 100)} if(User:keyJump()){holoPos(1, holoEntity(1):pos() + holoEntity(1):angles():up() * 4 * WalkSpeed * TickRate / 100)} if(NoclipCooldown == 0){ if(User:keyPressed("V")){ Noclip = 0 NoclipCooldown = 1 timer("noclipcooldown",200) } } } else{ if(User:keyForward()){holoPos(1,holoEntity(1):pos() + holoEntity(2):forward() * WalkSpeed * TickRate / 100)} elseif(User:keyBack()){holoPos(1,holoEntity(1):pos() - holoEntity(2):forward() * WalkSpeed * TickRate / 100)} if(User:keyLeft()){holoPos(1,holoEntity(1):pos() - holoEntity(2):right() * WalkSpeed * TickRate / 100)} elseif(User:keyRight()){holoPos(1,holoEntity(1):pos() + holoEntity(2):right() * WalkSpeed * TickRate / 100)} #TODO jumping if(NoclipCooldown == 0){ if(User:keyPressed("V")){ Noclip = 1 NoclipCooldown = 1 timer("noclipcooldown",200) } } } if(clk("noclipcooldown")){NoclipCooldown = 0} if(User:keyPressed("down")){ Scale-=0.1 } elseif(User:keyPressed("up")){ Scale+=0.1 } Anim = getAnimation() if(changed(Anim)){ holoAnim(2,Anim,0,1 / Divider) } #Interaction rangerIgnoreWorld(1) RangerEyeTrace = rangerOffset(9999,holoEntity(1):pos() + vec(0,0,holoEntity(1):height() * Scale * 0.85),owner():eyeAngles():forward()) TargEnt = RangerEyeTrace:entity() #if(changed(TargEnt)){print(TargEnt)} if(User:keyPressed("F")){ if(TargEnt:id() != 0){ BS = TargEnt:boxSize() holoPos(3,TargEnt:pos()) holoModel(3,TargEnt:model()) holoVisible(3,User,1) holoAng(3,TargEnt:angles()) holoAng(RH,owner():eyeAngles()) if(User:keyAttack1()){ print("No guns installed") } if(InteractCooldown == 0){ if(User:keyReload()){ TargEnt:use() timer("interactCooldown",500) InteractCooldown = 1 } if(User:keyAttack2()){ InteractCooldown = 1 timer("interactCooldown",500) if(ObjectGrabbed){ TeleEnt:deparent() ObjectGrabbed = 0 } else{ #TargEnt:setPos(holoEntity(RH):pos()) timer("teleParent",5) holoVisible(RH,players(),1) TeleEnt = TargEnt ObjectGrabbed = 1 } } } } else{ holoVisible(3,User,0) } } else{ holoVisible(3,User,0) } #print(owner():aimPos():distance(owner():pos())) if(clk("teleParent")){ TargEnt:parentTo(holoEntity(RH)) } elseif(clk("interactCooldown")){ InteractCooldown = 0 } #Commands if(chatClk(owner())){ CMD = owner():lastSaid():lower():explode(" ") if(CMD[1,string] == ".h"){ hideChat(1) if(CMD[2,string] == "go"){ if(CMD[3,string] == "#random"){ DestPly = players()[randint(1,players():count()),entity] DestPos = DestPly:pos() printColor(vec4(100,100,255,100),"Ghost: ",vec4(255),"Teleporting to: ",vec(255,0,255),DestPly:name()) } else{ DestPos = DestinationBoth[CMD[3,string],vector] if(DestPos == vec(0)){ DestPly = findPlayerByName(CMD[3,string]) DestPos = DestPly:pos() printColor(vec4(100,100,255,100),"Ghost: ",vec4(255),"Teleporting to: ",vec(255,0,255),DestPly:name()) } } holoPos(1,DestPos) } elseif(CMD[2,string] == "t"){ printColor(vec4(100,100,255,100),"Ghost: ",vec4(255),"Transferring...") if(User:name() == ""){ holoPos(1,owner():pos()) Pod:use() } else{ RangerEyeTrace = rangerOffset(9999,holoEntity(1):pos() + vec(0,0,holoEntity(1):height() * Scale * 0.85),owner():eyeAngles():forward()) OPos = Pod:pos() Pod:setPos(RangerEyeTrace:pos()) timer("gtfo",50) } } elseif(CMD[2,string] == "cloak"){ if(holoEntity(2):getAlpha() == 255){ printColor(vec4(100,100,255,100),"Ghost: ",vec4(255),"Cloak engaged.") holoAlpha(2,100) holoVisible(2,players(),0) holoVisible(4,players(),0) holoVisible(2,User,1) } else{ holoAlpha(2,255) holoVisible(2,players(),1) holoVisible(4,players(),1) printColor(vec4(100,100,255,100),"Ghost: ",vec4(255),"Cloak disengaged.") } } } } if(clk("gtfo")){ Pod:ejectPod() Pod:setPos(OPos) }