Divran's E2 Thread

Remake
My old E2 thread called “I’ll make E2s for you guys!” was removed (Due to some sort of bug. Wasn’t a moderator), so I decided to make a new one.

A minute for lost E2s
Let’s all take a minute for all the 8 pages full of awesome E2s that were lost with the old thread (Ahem… or not xD)

Ask for E2s
Basically, ask for an E2 and I’ll try to make it, as long as it isn’t too hard.
Remember, I’m only one guy. I can’t make too complicated stuff, and I can’t make E2s for 5 people at once.

Your own E2s
You’re welcome to help me help other people by posting your own creations using ideas from this thread.
If you do, be prepared that I might optimize it and/or give positive feedback. If you for some reason don’t like this, then don’t post your E2s.

Thanks
Thanks to everyone who helped me in the old thread, and prevented it from turning into another flame war. Keep up the good job in this new thread!

Allright, let’s go!

I wonder why the old thread was vaporized.

if you want, I can post some of the E2’s I got out of the old thread

Yeah do that.

Hey Ill post as many as I got from the thread (all that intrested me)
(that was an amazing thread takes off hat and bows)
------------And can you make an E2 that will act as a gyroscope? (dampen pitch, yaw, and roll)-------------------------

Now for the lost codes (I know this is long but here you go, sorry). Here is the applyforce hoverer Dirivan mande for me:


@name Hoverer..er
@persist E:entity Dist:vector HoverHeight
if (first()|duped()) {
    #Change the hover height here. Or make yourself an input for it.
    HoverHeight = 100
    E = entity():isWeldedTo()
    runOnTick(1)
}

#Rangerfilter the prop
rangerFilter(E)
#Get ranger data
Ranger = rangerOffset(E:massCenter(),E:massCenter()-HoverHeight+1)
#If the ranger hit..
if (Ranger:hit()) {
    #Get the distance force
    Dist = vec(0,0,HoverHeight-Ranger:distance())
    #Apply the force
    E:applyForce((Dist*10-E:vel())*E:mass()*vec(0,0,1)) 
    #If you remove * vec(0,0,1) it will prevent left/right/forward/back movement.
}

#Bonus! NOTE: ADVANCED! I suggest you ignore this if you don't understand it..
#Uncomment below for some applyTorque quaterniton stabilization :P
#You will probably have to change the multipliers first.
#Mul1 = 50
#Mul2 = 2
#Torque = E:toLocal(rotationVector((quat(ang(0,0,0))/quat(E)))+E:massCenter())
#E:applyTorque((Torque*Mul1-E:angVelVector()*Mul2)*E:inertia()*!E:isPlayerHolding())

Now for an E2 that makes props circle your head than launch at your crosshair on secondary fire:


@name Prop Circle
@persist Ent1:entity Ent2:entity Ent3:entity Ent4:entity Ent5:entity Ent6:entity
@persist Pos1:vector Pos2:vector Pos3:vector Pos4:vector Pos5:vector Pos6:vector
@persist Mode:string Nr C M DontSearch K
@trigger all


# Hello! This expression was made by Divran.
# Controls:
# Mouse2 to shoot the prop. Sorry, it's not 100% accurate. :(
# Crouch + Mouse2 to manually rescan ALL the props (Drops them all then rescans)
# Walk up to a prop to automatically pick it up.
# It only targets and only works on your own props.
# Have fun!

#Don't change anything below here.

runOnTick(1)

#Auto Rescan
if (clk("Rescan")) {
    findClearBlackList()
    findClearWhiteList()
    findIncludePlayerProps(owner())
    findExcludeEntity(Ent1), findExcludeEntity(Ent2), findExcludeEntity(Ent3), findExcludeEntity(Ent4), findExcludeEntity(Ent5), findExcludeEntity(Ent6)
    findByClass("prop_physics")
    findSortByDistance(owner():shootPos())
    if (find():massCenter():distance(owner():shootPos()) < 500) {
        if (Nr == 0) {
            if (find() != noentity()) {Nr = 1,Ent1 = find()}
        } elseif (Nr == 1) {
            if (find() != noentity()) {Nr = 2,Ent2 = find()}
        } elseif (Nr == 2) {
            if (find() != noentity()) {Nr = 3,Ent3 = find()}
        } elseif (Nr == 3) {
            if (find() != noentity()) {Nr = 4,Ent4 = find()}
        } elseif (Nr == 4) {
            if (find() != noentity()) {Nr = 5,Ent5 = find()}
        } elseif (Nr == 5) {
            if (find() != noentity()) {Nr = 6,Ent6 = find()}
        }
    }
}

#Auto rescan timer
if (Nr != 6 & !DontSearch) {timer("Rescan",500)}
#Crouch + Mouse2 rescanning all props
K = owner():isCrouch()
if (K & $M == 1) {Ent1 = Ent2 = Ent3 = Ent4 = Ent5 = noentity(), timer("Rescan",1)}
if (clk("Search")) {DontSearch = 0}

#How many do we have?
Nr = (Ent1:model()!="")+(Ent2:model()!="")+(Ent3:model()!="")+(Ent4:model()!="")+(Ent5:model()!="")+(Ent6:model()!="")

#Shooting
M = owner():keyAttack2()
if ($M == 1) {
    if (Nr == 6) {
        Pos6 = (owner():aimPos()-Ent6:massCenter())* Ent6:inertia():length()^1.5
        Ent6:applyForce(Pos6+$Pos6*5)
        Ent6 = noentity()
    } elseif (Nr == 5) {
        Pos5 = (owner():aimPos()-Ent5:massCenter())* Ent5:inertia():length()^1.5
        Ent5:applyForce(Pos5+$Pos5*5)
        Ent5 = noentity()
    } elseif (Nr == 4) {
        Pos4 = (owner():aimPos()-Ent4:massCenter())* Ent4:inertia():length()^1.5
        Ent4:applyForce(Pos4+$Pos4*5)
        Ent4 = noentity()
    } elseif (Nr == 3) {
        Pos3 = (owner():aimPos()-Ent3:massCenter())* Ent3:inertia():length()^1.5
        Ent3:applyForce(Pos3+$Pos3*5)
        Ent3 = noentity()
    } elseif (Nr == 2) {   
        Pos2 = (owner():aimPos()-Ent2:massCenter())* Ent2:inertia():length()^1.5
        Ent2:applyForce(Pos2+$Pos2*5)
        Ent2 = noentity()
    } elseif (Nr == 1) {   
        Pos1 = (owner():aimPos()-Ent1:massCenter())* Ent1:inertia():length()^1.5
        Ent1:applyForce(Pos1+$Pos1*5)
        Ent1 = noentity()
    }
    #Stop searching for new props for a while, otherwise it will catch the prop in midair as you shoot it.
    DontSearch = 1
    timer("Search",2000)
} else {
    
    #Flying
    if (Ent1 != noentity()) {
        C = 0
        Circle1 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
        Pos1 = (owner():pos()+vec(0,0,120)+Circle1-Ent1:massCenter())* Ent1:inertia():length()^1.5
        Ent1:applyForce(Pos1+$Pos1*5)
    }
    if (Ent2 != noentity()) {
        if (Nr == 2) {C = 180} elseif (Nr == 3) {C = 120} elseif (Nr == 4) {C = 90} elseif (Nr == 5) {C = 72} elseif (Nr == 6) {C = 60}
        Circle2 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
        Pos2 = (owner():pos()+vec(0,0,120)+Circle2-Ent2:massCenter())* Ent2:inertia():length()^1.5
        Ent2:applyForce(Pos2+$Pos2*5)
    }
    if (Ent3 != noentity()) {
        if (Nr == 3) {C = -120} elseif (Nr == 4) {C = -90} elseif (Nr == 5) {C = -72} elseif (Nr == 6) {C = -60}
        Circle3 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
        Pos3 = (owner():pos()+vec(0,0,120)+Circle3-Ent3:massCenter())* Ent3:inertia():length()^1.5
        Ent3:applyForce(Pos3+$Pos3*5)
    }
    if (Ent4 != noentity()) {
        if (Nr == 4) {C = 180} elseif (Nr == 5) {C = 144} elseif (Nr == 6) {C = 120}
        Circle4 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
        Pos4 = (owner():pos()+vec(0,0,120)+Circle4-Ent4:massCenter())* Ent4:inertia():length()^1.5
        Ent4:applyForce(Pos4+$Pos4*5)
    }
    if (Ent5 != noentity()) {
        if (Nr == 5) {C = -144} elseif (Nr == 6) {C = -120}
        Circle5 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
        Pos5 = (owner():pos()+vec(0,0,120)+Circle5-Ent5:massCenter())* Ent5:inertia():length()^1.5
        Ent5:applyForce(Pos5+$Pos5*5)
    }
    if (Ent6 != noentity()) {
        if (Nr == 6) {C = 180}
        Circle6 = vec(0,100+Nr*20,0):rotate(ang(0,100*curtime(),0)+ang(0,C,0))
        Pos6 = (owner():pos()+vec(0,0,120)+Circle6-Ent6:massCenter())* Ent6:inertia():length()^1.5
        Ent6:applyForce(Pos6+$Pos6*5)
    }

}

Now for a wieght measuring ranger:


@name Ranger Weight
@outputs Weight
interval(5000) #Doesn't need to update any faster, really.
Weight = ranger(200):entity():mass() #Check for an entity 200 units in front of the E2. Change this distance if you want.

And the advanced wieght measuring ranger:


@name Adv Ranger Weight
@outputs Weight
interval(5000) #Doesn't need to update any faster either.
Ent = ranger(200):entity() #Check for an entity 200 units in front of the E2. Change this distance if you want.
Props = Ent:getConstraints() #Gets all the props
Props:pushEntity(Ent) #This was the fix. This adds the Ent to the array.
Weight = 0 #Resets weight to 0 before calculating
for(I=1,Props:count()) {Weight+=Props:entity(I):mass()} #Calculates the mass of all the props]

Now for one that makes props float above you and intercepts RPG’s"


@name Auto Anti RPG - AAR
@inputs Base:entity Prop:entity
@outputs Mode:string Target:entity
@persist Mode:string Pos:vector Ang:angle Target:entity Dist Nr DistDetect DistFly
@trigger all
runOnTick(1)

if (Nr == 0) {
    #Nr:
    Nr = 1 #If you want to have multiplie AAR's change this Nr. If you have two AAR's, change the Nr of the first one to 1 and the second one to 2.
    DistDetect = 2000 #How far away it will scan
    DistFly = 1300 #How far away it will fly (Make this slightly lower than the detection radius)
}

if (Mode == "") {Mode = "Scan"}
#Scanning:
timer("Rescan",250)
if (Target == noentity() & clk("Rescan")) {
    findClearWhiteList()
    findClearBlackList()
    findByClass("rpg*")
}
if (Mode == "Scan" & Target == noentity()) {
    findSortByDistance(Base:massCenter())
    Dist = findResult(Nr):pos():distance(Base:massCenter())
    if (Dist < DistDetect & findResult(Nr)) {
        Target = findResult(Nr)
        Mode = "Intercept"
   }
}


#Intercepting:
if (Mode == "Intercept") {
    Dist = find():pos():distance(Base:massCenter())
    Pos = ((Base:massCenter() + ((Target:pos() + vec(0,0,20) - Base:massCenter()) / Dist) * clamp(Dist,200,DistFly)) - Prop:massCenter()) * 3000
    Ang = ang(Prop:elevation(Base:massCenter())+90, Prop:bearing(Base:massCenter()), Prop:angles():roll()) * -8000
    if (!Target | Target == noentity() | Dist > DistDetect) {Mode = "Scan", Target = noentity()}
} else {
    Pos = (Base:massCenter() + vec(0,0,Nr*20) - Prop:massCenter()) * 3000
    Ang = Prop:angles() * -8000
}

    #Flight:
    Prop:applyForce(Pos+$Pos*7)
    Prop:applyAngForce(Ang+$Ang*10)

Now for a follower E2:


@name Follower
@inputs
@outputs
@persist Destination:vector CurrentPos:vector Velocity:vector
@trigger all
runOnTick(1)
Destination = owner():pos() + vec(0,0,100)
CurrentPos = entity():massCenter()
Velocity = entity():vel()
entity():applyForce((Destination - CurrentPos) * 50 - Velocity)There are of course other, better ways of doing it. This is just one way. (You may want to change the ^ velocity)


And and E2 that causes selected props to fly at your crosshair on command with great velocity:


@name MatadorForAll
@persist E:entity O:entity Hold Attack Dest:vector Vec:vector Ang:angle
if(first()){
    #Make the angle for the death ball to spin randomly
    A = 45
    Ang = ang(randint(-A,A),randint(-A,A),randint(-A,A)) * 50000
    #Hide the chip
    entity():setColor(0,0,0,0)
    O = owner()
    runOnTick(1)
}

Pos=E:pos()
#Spin the ball randomly
E:applyAngForce(Ang+$Ang*5)
#Only hover if the owner is alive
if(O:isAlive()){
    #If holding, then move the chip above the owners head
    if(Hold){
        #Set Destination
        Dest=O:pos()+vec(0,0,(200+E:radius()))
        #If the ball is close, move slowly and accurately
        if(Pos:distance(Dest)<50){
            Attack = 0
            Vec=(Dest-Pos)*E:mass()
            E:applyForce(Vec+$Vec*5)
        }
        #If its far away, move quickly
        else{
            Vec=(Dest-Pos)*E:mass()*Pos:distance(Dest)*50000
            E:applyForce(Vec)
        }
    }
    #If the owner left clicks, start the attack sequence
    if(Attack==0&O:keyAttack1()&E&O:aimEntity()!=E){
        #Just incase it gets stuck
        stoptimer("ManualReset")
        timer("ManualReset",3000)
        Dest=O:aimPos()
        Hold=0
        Attack=1
    }
    #Attack Code - Strikes the spot once
    if(Attack==1){
        Vec=(Dest-Pos)*E:mass()*50000*Pos:distance(Dest)
        E:applyForce(Vec)
        #When the ball reaches its target, go back to holding
        if((Pos:distance(Dest)<20)){
            Attack=2
            Hold=1
        }
    }
    #Attack 2 code - Flys constantly at the spot
    if(O:keyAttack2()&E&O:aimEntity()!=E){
        Attack=0
        Hold=1
        Dest=O:aimPos()
        Vec=(Dest-Pos)*E:mass()*50000*Pos:distance(Dest)
        E:applyForce(Vec)
    }
    if((O:keyUse()|O:keyAttack1()|O:keyAttack2())&!E){
        print("ERROR: No prop selected")
    }
    #If porp is stuck, return to owner
    if(clk("ManualReset")){
        Attack=0
        Hold=1
    }
    #Prop selection code
    if(O:keyUse()&O:aimEntity()&O:aimEntity()!=E){
        #Set the old prop to 5 mass and remove the trail
        E:setMass(5)
        E:removeTrails()
        #Designate the new prop and play with its properties
        E=O:aimEntity()
        E:setMaterial("models/debug/debugwhite")
        #E:setMaterial("models/props_combine/metal_combinebridge001")
        E:setMass(80000)
        print("Prop selected")
        Hold=1
    }
}

^instructions: Press E on a prop, to select it. With MB1 you order the prop to go somewhere, by holding MB2 you do the same shit, but if you release it it comes back to your head.

Your welcome!
=^…^=
( ! ! )…

That’s a lot. :smiley:
But just so you know, that Prop Circle E2 sucks. I’ve already made one that can use an unlimited amount of props.
And to anyone who asks, I didn’t make “MetadorForAll”

Edit:


@name E2 Gyroscope
@inputs Ent:entity OffsetPitch OffsetYaw OffsetRoll OffsetAngle:angle
@outputs Pitch Yaw Roll Angle:angle PitchVel YawVel RollVel AngleVel:angle
runOnTick(1)
#If Ent is wired, use that, else use the E2 itself:
En = (Ent ? Ent : entity())
#Set the offset (and prioratize the :angle input over numeric inputs):
Offset = (OffsetAngle ? OffsetAngle : ang(OffsetPitch,OffsetYaw,OffsetRoll) )
#Get the angle:
Angle = En:angles() + Offset
#Get the angle velocity:
AngleVel = En:angVel()
#Numeric outputs:
Pitch = Angle:pitch()
Yaw = Angle:yaw()
Roll = Angle:roll()
PitchVel = AngleVel:pitch()
YawVel = AngleVel:yaw()
RollVel = AngleVel:roll()

about how much dampening is there? I dont want keepupright just to be clear. (I havent tested yet)…

Oh is there a way this could be turned on and off? I am using it in a VTOL to smooth touchy handling. I would prefer it only to be active during vertical flight (shit key) so that the plane maintains its manuverability in horizontal flight

LOL I had a blast with the prop circle e2!!! If your telling me there is a better version then LOL

Dampening? I didn’t put any dampening in there. It’s just a gyroscope with some Offset inputs. What do you mean by “dampening”?

Put “On” in inputs, after all the Offset inputs, and then put a giant “if (On) { … }” around all the code. Let me know if you don’t get it.

And yes. Ever heard of Balls of Steel? When I saw that E2, I tried to make my own. After several tries, I got it working. It works almost just like balls of steel, with some of my own additions.

EDIT:
Here’s a really funny E2 I made that makes you say “HAX” whenever you use the crowbar:


@name Crowbar Hax
interval(10)
Atk = owner():keyAttack1()
Wpn = owner():weapon():type()
if (Atk & Wpn == "weapon_crowbar") {
    timer("Sound",700)
    if (clk("Sound") | changed(Atk)) {
        owner():soundPlay(1,0.7,"vo/npc/male01/hacks0"+randint(1,2)+".wav")
        soundPitch(1,165)
    }
} else {soundStop(1)}

And here is V2. It does the same thing, except works for everyone on the entire server at the same time. And it’s just generally better than the other one.


@name Crowbar Hax for Everone
@persist Ply:array PlyUse:array
if (first()) {
    findByClass("player")
    Ply = findToArray()
    for(I=1,Ply:count()) {PlyUse[Ply:entity(I):id(),number] = 45, holoCreate(I),holoPos(I,Ply:entity(I):shootPos()),holoParent(I,Ply:entity(I)),holoAlpha(I,0)}
}
interval(10)
for(I=1,Ply:count()) {
    En = Ply:entity(I)
    Atk = En:keyAttack1()
    Wpn = En:weapon():type()
    if (Atk & Wpn == "weapon_crowbar") {
        Nr = PlyUse[En:id(),number]
        PlyUse[En:id(),number] = Nr + 1
        if (Nr>50) {
            PlyUse[En:id(),number] = 0
            holoEntity(I):soundPlay(I,0.7,"vo/npc/male01/hacks0"+randint(1,2)+".wav")
            soundPitch(I,165)
        }
    } else {soundStop(I), PlyUse[En:id(),number] = 45}
}

Never posted this, but might as well. It’s my old chatbot, some shit might not work anymore, but meh:


@name Jmazouri's Incredible chat Parser [JIP] v0.6
@inputs Link:wirelink
@outputs Update
@persist
@trigger 

#################################################################################################

if (first()|duped()) {
    concmd("wait 150; say "+"[JIP] Has just been spawned! Find it on the map!")
}

timer("update",10000)

if (clk("update")) {
    Update = 1
} else {Update = 0}

if (first()) {
    holoCreate(550)
    holoCreate(551)
    holoCreate(552)
    holoCreate(553)
    holoCreate(554)
    holoCreate(555)
    holoCreate(556)
    holoPos(550,entity():pos()+vec(0,-20,50))
    holoPos(551,entity():pos()+vec(0,-27,31))
    holoPos(552,entity():pos()+vec(0,10,45))
    holoPos(553,entity():pos()+vec(0,10,59))
    holoPos(554,entity():pos()+vec(0,10,31))
    holoPos(555,entity():pos()+vec(0,40,45))
    holoPos(556,entity():pos()+vec(0,54.2,54.6))
    holoScaleUnits(550,vec(1,10,30))
    holoScaleUnits(551,vec(1,25,10))
    holoScaleUnits(552,vec(1,10,20))
    holoScaleUnits(553,vec(1,30,10))
    holoScaleUnits(554,vec(1,30,10))
    holoScaleUnits(555,vec(1,10,40))
    holoScaleUnits(556,vec(1,20,20))
    holoMaterial(550,"models/XQM/LightLinesGB")
    holoMaterial(551,"models/XQM/LightLinesGB")
    holoMaterial(552,"models/XQM/LightLinesGB")
    holoMaterial(553,"models/XQM/LightLinesGB")
    holoMaterial(554,"models/XQM/LightLinesGB")
    holoMaterial(555,"models/XQM/LightLinesGB")
    holoMaterial(556,"models/XQM/LightLinesGB")
}

    #Link:writeString("[JIP] Command List, v0.6",3,2,900,0,1) 
    #Link:writeString("OWNER ONLY COMMANDS",1,4,119,0,0) 
    #Link:writeString("kill, playerinfo, entinfo,",1,6,900,0,0) 
    #Link:writeString("music, musiclist, stopmusic,",1,8,900,0,0) 
    #Link:writeString("musicvolume",1,10,900,0,0) 
    #Link:writeString("GLOBAL COMMANDS (ANYONE)",1,12,191,0,0)
    #Link:writeString("8ball, givehp, comusage",1,14,900,0,0) 

#################################################################################################
runOnTick(1)
runOnChat(1)


RandomInteger1 = randint(1,3)
RandomInteger2 = randint(1,19)

JipTrig = owner():lastSaid():explode(" ")

Var1 = JipTrig:string(1)
Var2 = JipTrig:string(2)
Var3 = JipTrig:string(3)
Var4 = JipTrig:string(4)
Var5 = JipTrig:string(5)
Var6 = JipTrig:string(6)
Var7 = JipTrig:string(7)
Var8 = JipTrig:string(8)
Var9 = JipTrig:string(9)
Var10 = JipTrig:string(10)
Var11 = JipTrig:string(11)
Var12 = JipTrig:string(12)
Var13 = JipTrig:string(13)
Var14 = JipTrig:string(14)
Var15 = JipTrig:string(15)
Var16 = JipTrig:string(16)
Var17 = JipTrig:string(17)
Var18 = JipTrig:string(18)
Var19 = JipTrig:string(19)
Var20 = JipTrig:string(20)

Player = findPlayerByName(Var3)


#################################################################################################

if (chatClk(owner()) == 1) {

#################################################################################################

if (Var1 == "jip") {
    
#################################################################################################    
# "kill" function

        if (Var2 == "kill") {
            Random = RandomInteger1
            if (Random == 1) {
                Type = "maul"
            } elseif (Random == 2) {
                Type = "slay"
            } elseif (Random == 3) {
                Type = "sslay"
            }
            if (Random == 1| Random == 2| Random == 3) {
            concmd("ulx "+Type+" "+findPlayerByName(Var3):name())
        }
}

#################################################################################################
# "findinfo" function

if (Var2 == "entinfo") {
    
        PointEnt = owner():aimEntity()
        
     if (PointEnt) {
            
            if (PointEnt:isPlayer()) {
                hint("Use \"playerinfo\" for players!",10)
                } 
                
        else {     
        hint("Type: "+PointEnt:type(),10)
        hint("R: "+PointEnt:getColor():x():toString(),10)
        hint("G: "+PointEnt:getColor():y():toString(),10)
        hint("B: "+PointEnt:getColor():z():toString(),10)
        hint("Owned by: "+PointEnt:owner():name(),10)
        hint("Ent ID: "+PointEnt:id():toString(),10)
        hint("Model: "+PointEnt:model(),10)
        }
    } 
    else {hint("You can't use this on the world, silly.",7)}
}

#################################################################################################
# "playerinfo" function

if (Var2 == "playerinfo") {

    if (Var3 != "") {
        Player = findPlayerByName(Var3)
        if (Player) {
        if(Player:isAdmin()==1){IsAdmin="Yes"}
        else {IsAdmin="No"}
        if(Player:isSuperAdmin()==1){IsSuperAdmin="Yes"}
        else {IsSuperAdmin="No"}
    hint("Name: "+Player:name(),10)
    hint("SteamID: "+Player:steamID(),10)
    hint("EntID: "+Player:id():toString(),10)
    hint("Ping: "+Player:ping():toString(),10)
    hint("Model: "+Player:model(),10)
    hint("Is an Admin?: "+IsAdmin,10)
    hint("Is a SuperAdmin?: "+IsSuperAdmin,10)
    }
    else {hint("Name was not found.",10)}
}
    else {hint("That is not a Player! Use \"entinfo\"!",10)}
}

#################################################################################################

# "music" function

    if (Var2 == "music") {
        Ballsack = table()
        Ballsack:setString("stillalive","music/portal_still_alive.mp3")
    Ballsack:setString("4kdegreeskelvin","music/portal_4000_degrees_kelvin.mp3")
    Ballsack:setString("gamestartup1","ui/gamestartup1.mp3")
    Ballsack:setString("gamestartup2","ui/gamestartup2.mp3")
    Ballsack:setString("gamestartup3","ui/gamestartup3.mp3")
    Ballsack:setString("gamestartup4","ui/gamestartup4.mp3")
    Ballsack:setString("gamestartup5","ui/gamestartup5.mp3")
    Ballsack:setString("gamestartup6","ui/gamestartup6.mp3")
    Ballsack:setString("gamestartup7","ui/gamestartup7.mp3")
    Ballsack:setString("ravebreak","ravebreak.mp3")
    if (Var3 == "stillalive" | Var3 == "4kdegreeskelvin" | Var3 == "gamestartup1" | Var3 == "gamestartup2" | Var3 == "gamestartup3" | Var3 == "gamestartup4" | Var3 == "gamestartup5" | Var3 == "gamestartup6" | Var3 == "gamestartup7"  | Var3 == "ravebreak") {
    owner():soundPlay(7331,0,Ballsack:string(Var3))
    } else {
    hint("That song does not exist!",10)}
    }

    if (Var2 == "musiclist") {
    concmd("wait 150;say Current [JIP] Music List, v0.6")
    concmd("wait 300;say To use, say \"jip music (songindexhere)\"")
    concmd("wait 450;say stillalive, 4kdegreeskelvin, gamestartup1-7, ravebreak")
}

   if (Var2 == "stopmusic") {
    soundStop(7331) 
}

   if (Var2 == "musicvolume") {
    soundVolume(7331,Var3:toNumber()) 
}

#################################################################################################
#DO NOT REMOVE THESE TWO }s THEY ARE THE MOST IMPORTANT }s EVER
}
}


#################################################################################################
#################################################################################################
#################################################################################################
#Begin serverwide functions

JipTrigS = lastSaid():lower():explode(" ")

Var1S = JipTrigS:string(1)
Var2S = JipTrigS:string(2)
Var3S = JipTrigS:string(3)
Var4S = JipTrigS:string(4)
Var5S = JipTrigS:string(5)
Var6S = JipTrigS:string(6)
Var7S = JipTrigS:string(7)
Var8S = JipTrigS:string(8)
Var9S = JipTrigS:string(9)
Var10S = JipTrigS:string(10)
Var11S = JipTrigS:string(11)
Var12S = JipTrigS:string(12)
Var13S = JipTrigS:string(13)
Var14S = JipTrigS:string(14)
Var15S = JipTrigS:string(15)
Var16S = JipTrigS:string(16)
Var17S = JipTrigS:string(17)
Var18S = JipTrigS:string(18)
Var19S = JipTrigS:string(19)
Var20S = JipTrigS:string(20)

#################################################################################################

if (chatClk() == 1) {
JipLastSpokeS = lastSpoke()

#################################################################################################

if (Var1S == "jip") {
    
#################################################################################################    
# "8ball" function

        if (Var2S == "8ball") {
            if (Var3S == "do" | Var3S == "does" | Var3S == "am" | Var3S == "is" | Var3S == "should" | Var3S == "are" | Var3S == "did" | Var3S == "can" | Var3S == "will" | Var3S == "were" | Var3S == "have"| Var3S == "has") {
            Random = RandomInteger2
            Array = array()
            Array:setString(1,"My sources say Yes.")
            Array:setString(2,"My sources say no.")
            Array:setString(3,"Yes.")
            Array:setString(4,"No.")
            Array:setString(5,"Maybe.")
            Array:setString(6,"It is unknown.")
            Array:setString(7,"Do I look like I know?")
            Array:setString(8,"It's pretty damn obvious.")
            Array:setString(9,"Why are you so dense? Of course!")
            Array:setString(10,"You're kidding, right?. Of course not.")
            Array:setString(11,"There's a small chance.")
            Array:setString(12,"No, you goddamn retard.")
            Array:setString(13,"Yes, yes, a million times yes!")
            Array:setString(14,"Faggot.")
            Array:setString(15,"I'm an 8ball. I don't know everything.")
            Array:setString(16,"Some things, you don't need to know.")
            Array:setString(17,"You don't want to know...")
            Array:setString(18,"I think you already know the answer.")
            Array:setString(19,"Wat?")
            

            concmd("wait 150;say "+"[JIP] 8Ball says: "+Array:string(Random))
            }
            else {concmd("wait 160; say \"[JIP] 8Ball says: That's not how you use an 8ball, fucktard.\"")}
        }

#################################################################################################

# "givehealth" function

    if (Var2S == "givehp") {
        CurrentHP = lastSpoke():health()
        if (CurrentHP >= 90) {
            concmd("wait 150;say [JIP] "+lastSpoke():name():left(10)+", your health is fine.")
        } else {
        HPtoSet = CurrentHP+Var3S:toNumber()
        if (Var3S:toNumber()+CurrentHP > 101) {
            concmd("wait 150;say [JIP] "+lastSpoke():name():left(10)+", your health can't be >100.")
        }
        else {
        concmd("ulx hp "+"\""+lastSpoke():name()+"\""+HPtoSet) 
        }
    }
}

#################################################################################################

# "comusage" function

    if (Var2S == "comusage") {
        if (Var3S == "8ball") {
            concmd("wait 150;say [JIP] \"jip 8ball [question]\"")
        }
        elseif (Var3S == "givehp") {
            concmd("wait 150;say [JIP] \"jip givehp [numberofhitpoints]\"")
        }
    }
        
#################################################################################################    

#DO NOT REMOVE THESE TWO }s THEY ARE THE MOST IMPORTANT }s EVER
}
}



Wirelink it to a console screen, then uncomment the Link:* lines for a command list.

now if only i knew what an E2 was…

When I say dampening I am refering to making something resist pitching, rolling, and yawing. I want it to smooth the movements of my touchy vtol

how about an E2 that warns someone not to touch something and if they touch it, it kills them with an applyforce ball and yells “I TOLD YA DON’T TOUCH THAT DARN THING.” i’d make it, but i don’t know applyforce.

Simple code for servers that let anyone enter your seats, I got it from someone but I don’t remember who, I added a few things too but I have not tested this since a few major wiremod changes.



@name AHC
@inputs Pod:wirelink
@outputs 
@persist 
@trigger all

interval(100)

#Anti-Hijacker Code

if(Pod:entity("Entity"):driver():steamID() != owner():steamID() & Pod:number("Active") >= 1) {
Pod:printDriver("Terminated for trying to steal "+owner():name()+"'s vehicle.")
print(Pod:entity("Entity"):driver():name()+" tried to steal your vehicle.")
Pod:setNumber("Terminate", 1)
} else {
Pod:setNumber("Terminate", 0)
}


can you make me suspension?

Optimized:


@inputs Pod:wirelink
interval(500) #Doesn't need to be faster.
Pod["Terminate",number] = Pod["Entity",entity]:driver() != owner() #If the driver isn't you, terminate.
#You could of course put those print messages in here if you want.

[editline]04:03PM[/editline]

An applyForce suspension or what? I’ve tried that once but failed. Although that was a while ago.
Making a suspension out of applyForce sucks. The best suspensions are either rope tool, elastics, or weight changing.

[editline]04:05PM[/editline]

Use Delta:


@name Delta example
@inputs Pitch
@outputs Pout
Pout = -Pitch - $Pitch * 4
#Copy this code for Yaw and Roll

Wire some thrusters to this to stabilize the prop.

I need an e2 that makes a yellow exclamation point (!) above your head. Sorry but im new to Expression 2

This can be done with the hologram functions. But I have no idea how to use them, so I’ll let Divran help ya thar


@name !!!
@persist 
@trigger 
O = owner()
# |
holoCreate(1,O:pos()+vec(0,0,120))
holoScale(1,vec(1,1,3))
holoColor(1,vec(255,255,0))
holoMaterial(1,"models/debug/debugwhite")
holoAng(1,O:angles())
# .
holoCreate(2,O:pos()+vec(0,0,90))
holoColor(2,vec(255,255,0))
holoMaterial(2,"models/debug/debugwhite")
holoAng(2,O:angles())

holoParent(1,O), holoParent(2,O)


thanks

An e2 that aims where I aim and floats NOT above my head but about 1 meter of the floor

Ps: you weld the e2 on any prop and it does it.


@name Yet another turret
@persist E:entity Ang:angle StartPos:vector
@trigger
runOnTick(1)
if (!E) {
    E = entity():isWeldedTo()
    StartPos = E:massCenter() + vec(0,0,E:boxSize():z() + 50)
} else {
    E:applyForce(((StartPos-E:massCenter())*10-E:vel())*E:mass())
    #You will need to change "Multiplier" for each different prop. But it must always be negative.
    Ang = ang(E:elevation(owner():aimPos()),E:bearing(owner():aimPos()),E:angles():roll()) * -Multiplier
    E:applyAngForce(Ang+$Ang*5)
}


UNTESTED