Scripting Equestria

by Wild Wire

First published

I somehow landed myself in Equestria, with the power of applying Garry's Mod LUA to reality.

You ever ask yourself, "What if I could do that?" after watching a superhero movie or reading a comic? I'm sure you have at some point. I somehow landed myself in Equestria, with the power of applying Garry's Mod LUA to reality, starting with Nothing but a floating notepad window, a simple console, and access to the Garry's Mod Wiki.

(This is basically my attempt at combining ideas from my cancelled stories Break The System and Modding Equestria into one story, while also nerfing the abilities, and taking it a bit more seriously. This will sometimes contain actual code and stuff, but you should be able to skip over that, I just feel like throwing it in for fun.)

lua_openscript prologue.lua

View Online

It was dark.

I wasn't in a forest at night, I wasn't in a dark room, I wasn't anywhere distinguishable at all. It was just pitch black. My entire body felt... How do you even describe feeling nothing? It was as if my body didn't even exist, I could only feel the ghost of it. A phantom feeling, if you will. I couldn't see, and I couldn't feel. I couldn't even hear anything! Did I die? What's the last thing I remember?

I was playing video games, of course. I didn't have much else to do at the time, so I was playing Garry's Mod, trying to fix a bug with a weapon I was working on. There weren't any script errors, but I still wanted to make it better. I was sitting at my computer, switching tabs between the game, Notepad, and the Garry's Mod Wiki. After that though, nothing. There was no memories between being at my computer, and being in this void. There had to be an explanation about what happened, and how I got here. Wherever here is.

I suppose I died somehow. That's really the only reason I could think of. I don't know how, or why, but I'm most likely dead. Why else would I not feel anything? I was nothing but a soul now. Nothing but my soul, everything that makes me who I am. No eyes to see with, no ears to hear with, and no body to feel with. Heh, nobody. I guess I could use this time to reflect on my life, the decisions I made that shaped others, and the experiences made that shaped me.

If I'm going to be honest with myself, I was kind of a jerk. I didn't do it on purpose, but that doesn't change anything. I tried to be nice to others, but most of the time I would end up saying something that would be considered rude without ever realizing it. I never really noticed I made anyone upset until they got mad enough to yell at me, and since I don't like being yelled at, I would usually just yell back. I wasn't perfect. I had anger issues, and I had trouble connecting with others on a normal level. Most of my friends were actually just people I met on Steam and occasionally played with.

I was a loser.

Nothing notably interesting about me. Yeah, I wanted friends, real friends that would have my back while I had their's, but I guess I never met anyone like that. Maybe I was setting my standards too high? I don't really know. I never really met anyone I truly liked enough to call a true friend, the closest I've ever got was those people you meet at school that you don't really hang out with but still talk to over lunch. I guess they could be considered friends, but it didn't really feel like it.

I don't want this to be the end. I tried to yell, scream, do something, anything! I couldn't move at all, because I had no body to move. It's still possible that I did have a body but just couldn't feel it. I was confused and scared and angry and I wanted to cry. I really wanted to cry. I tried to throw my phantom body around, but it had no effect. If I had a body, I couldn't tell if I had moved at all or back where it was. I couldn't distinguish anything from anything.

I just wish something would pop up!

A sound, not dissimilar to a quiet click, rang within my head, it wasn't loud, but compared to the quiet from before, it was deafening. That was a silly thought. It's the random sound from nothing that made me think I was going deaf. I tried to think of where the sound came from, but there wasn't really a point, since I had no sense of direction. I could be upside down for all I know. I could tell something was different now, but I couldn't place it. By instinct, I swerved my non existent head around, searching for the origin of the noise. And for the first time in ten minutes, I saw something.

A flat, white rectangle. A familiar one, that had words at the top. It said "Untitled - Notepad", right below that was "File, Edit, Format, View, Help" and below that was a small black blinking line. I cant even begin to describe how confused I was, so I'll leave it up to imagination. I slowly reached my imaginary hand out to it, and I felt it. I had the vaguest sense of touch, but I could tell it felt like ordinary printer paper. I put my other hand out and somehow pulled it closer to my sight.

I had no idea what to do next. I just have Notepad open, in a world where nothing exists. Who makes this stuff up? I didn't really have anything. Nothing but freaking NOTEPAD. I guess I could write something to pass the time? That sounded good. I needed to figure out how to write on it though. I decided to try typing with my phantom hands as if I had a keyboard. It didn't work and I felt silly. Then I remember that Notepad popped up when I wanted something to happen. Again, deciding it was worth a shot, I tried to type with nothing but my own will power, or I would have if I knew what to type. Thinking on it, I decided to just write a little 'hello world' script, as it was the first thing to come to mind.

print( "Hello world!" )

It was the dumbest thing I could think of but it put a smile on my face. I clicked 'save as' and hit save when a folder window popped up in front of Notepad. I simply named the file 'hello_world.lua'. When I hit save, another window popped up, this time completely black, with white text that said, you guessed it,

Hello world!

Stunned again, I quickly put my phantom fingers on top of the black paper thin box, and slid it to the side to see Notepad again. I quickly tried to think of what the code was. Do I have access to the wiki?

Another click sound.

I have access to the wiki. I look at the new box, and scroll through the site with my mind, looking for the code needed. Wait, there it is!

PrintTable( ents.FindInSphere( Vector( 0, 0, 0 ), 72 ) )

This code, in Garry's Mod, is supposed to look for every entity in a seventy-two unit radius of the center of the map. seventy-two units is also the height of the player's collision. I remember reading somewhere that if you measure the player with map units, they're only about four foot six, but with the actual human character model units you're supposed to measure them with, they're all six foot. I myself am only five foot nine, but now I'm just getting off topic. I saved the tiny script, and it ran through the console. What did it spit back out? I'll just show the important bit.

Entity [0][worldspawn]
Player [1][Mathew Heart]

That was me! I had just found myself using code! Who's awesome? I'm awesome! If I'm dead, I don't want to come back! Of course, I didn't really mean that, but it's not like I could revive myself. Wait. Hold up. I check notepad once more, tempted to try a command that had just popped up in my head.

Entity:Spawn( Entity( 1 ) )

I hesitated before saving it. If it really does work like Garry's Mod, then that means if I do this, I'll respawn. Did I really want to go back? What if I lose this cool new power? What if it doesn't even work? What if I come back a zombie? Obviously, I didn't receive an answer, and just because of that, I decided it was worth a shot. I wasn't going to spend the rest of eternity in an empty void.

I saved it.

Received all the LUA Files we needed!

View Online

With no warning at all, I was suddenly standing in the middle of a field, one that was way more green than anything I've seen in real life. Already I had suspicions. Turning my head in both directions to look around, I decide to make a mental list of what had just happened, just to catch myself up. I was in a void, I used LUA to find out where I was, and I brought myself back from the dead. Now, I have a body again, and I'm standing in a way too colorful field of grass with the sun shining across my skin.

I was only in that void for like, ten minutes, but now I'm overjoyed to just have my body back. I'm starting to think that if I had been in there too long, I would have gone mad. Aside from that, after looking around I found that I'm near some sort of gloomy forest, the clouds were all in small bundles, and generally everything looked like it came right out of a cartoon, which means despite reviving myself, I'm not on earth anymore. Maybe I could use LUA again to check where I'm at? I hope I still can. I open Notepad once again, the same way I did it before, and I write another code.

print( game.GetMap() )

Again, if it works like Garry's Mod, this should tell me where I'm at. I save the script and run it through the console.

world_equestria

Oh. Well that would explain the colors. Jeez, what am I even getting myself into? I have so many questions! First, where am I? Well, using logic, I'm guessing the gloomy forest is actually the Everfree, so I somewhat know where I am. I know I saw a map at one point on the internet, so I think if I go north, I should find Ponyville. Next, when am I? Well, all I know is that it's day time right now, so I don't have much to go off of quite just yet. I looked up and tried to tell the movement of the sun, but all I did is hurt my eyes. I don't know of any LUA commands that would give me the actual time, so It seems that I'll have to figure it out.

The sun was positioned over the forest, meaning that way could either be east or west, assuming the sun travels from east to west in this world. Watching the shadows of the trees for a little while, I determined the sun was rising, so that way was east, which means I am west of the forest. Remembering what I know of the map, I must be somewhere between the Everfree Forest and the White Tail Woods. If I look around, I should be able to find some train tracks, and if I go south, I might be able to find Ghastly Gorge.

All I have to do is walk around the forest clockwise, and I should find Ponyville with ease.


I've been walking for so darn long. I don't know how long it's been exactly, but I'm pretty sure it's been over an hour and a half. My legs haven't gotten tired at all, and I don't feel exhausted for walking so long, but I'm immensely bored. I'm pretty sure I would have gotten tired by now, as I wasn't exactly the most fit person. Maybe I had infinite stamina? I really only had one way to find out. Instead of walking, I began to run for as long as I could.

I've been running for ten minutes and I haven't gotten tired yet, so I just kept running instead of walking because it was faster and didn't seem to be affecting me. Actually, I just got an idea! I stop and open Notepad again, writing another command.

print( Entity( 1 ):GetRunSpeed() )

400

Okay, that's my maximum speed, now what if I just double that?

Entity( 1 ):SetRunSpeed( 800 )

No noticeable difference occurred, but I knew that the command is supposed to make me twice as fast only when I sprint. To give it a test, I begin to run again. I really was running twice as fast, but I felt like it still wasn't fast enough, so I stopped again and changed it from eight-hundred to one-thousand-two-hundred, three times as fast. I didn't want to go overboard with it and end up running into a wall at mach two, so I made a quick mental note to never go over three-thousand. Until I find a way to increase at least my reaction time, I'm not going over that limit.

Running at this speed was kind of a rush to be honest. Heh, rush. I could feel the wind around me as I sprinted as fast as I could. It was exhilarating. Not only that but since I was outside, and in a new world, it was also a breath of fresh air! Is this what I was missing on earth? I just, sat at a computer all the time, when I could have been outside, enjoying life?

Nah, earth was already mostly ruined when I left, and besides, if I didn't sit in front of a computer all day, I never would have learned the code that's allowing me to run this fast in the first place. I would say I did pretty okay. Up ahead, I could see the very edge of the town I was looking for within my vision. Now was probably a good time to stop running so fast. Slowing down and using another command to set my speed back to four-hundred, I approach the town.

There wasn't a giant crystal castle, so that put me before season four. Unless I was in a parallel universe, that's always a possibility. I began to think on that during my leisurely stroll. If someone woke up in a parallel universe, in that universes version of their bed, where not a lot was different, would they ever even notice that they're not home anymore? I suppose it really depends on how different the worlds are. It's definitely interesting to think about.

I was finally getting close enough to the town to see a pony strolling along.

Time to make some introductions.

[EQ] Ponyville RP [FastDL]

View Online

I could just barely make out that it was a pony I was looking at from here, but I continued at my strolling speed. I didn't want to go too fast because that could possibly startle them. If I startled them too much it could paint me in a very bad light, and I wanted nothing to do with that, not one bit. Speaking of bits, I'm eventually going to have to make some money. Hooray for me.

"Hello?" I called out to the pony once I was within hearing range. I was still pretty far, so whatever I say would probably be lost on them. The pony in question looked in my direction as I continued to almost speed walk to them, I was now close enough to tell that it was Carrot Top I had found. Anyways, even from some distance away I could tell she was already shaking a bit. I just hope she doesn't run off before I can talk to her. I stopped a little distance before her, and I spoke.

Or I would have, if she didn't do the exact thing I didn't want her to do. With nothing but a cartoon dust cloud left to signify that she booked it, I sighed. Walking farther into town while more ponies freaked out, some of them closing their windows or hiding in alleyways, I eventually found my way into an empty park. After a few minutes, I found a bench and sat down. This is what I was expecting, and I couldn't really do anything about it without making myself look more monsterous. If I ran out of town, the ponies would be scared of the mystery of me, and if I wanted to explain to anypony that I'm not bad, I would probably have to chase them down to do it, and that would definitely be a good image.

The best course of action I could think of is to sit and wait. If I'm patient enough, eventually one of them will be curious enough to come up to me. It might take a while, but I can wait.

Why did I come here again? What was my goal? I just sort of decided that I needed to get to Ponyville, didn't I? Wait, no, I wanted to find out what season I'm in, that's what it was. Well, I know I'm before season four now, so I guess that's good enough, Right? Oh, of course it's not, I'm me. I always want to know things and I don't like leaving anything to mystery. Maybe sometimes I'll leave things to the imagination, but never pure mystery. Too much mystery is just frustrating.

I didn't notice it at first, but at one point I began to hum out of boredom. I didn't know what song it was, but it seemed fitting for my current mood. And now it's stuck in my head.

Just fantastic.

"H-Hello?" A nearby pony approached, having seen me on the bench. I think this meant my plan of patience was already working. I stopped my humming thought about the best way to go about this.

"Hello." I answered, as calmly as I could, facing the pony in question. This pony looked familiar, but I couldn't think of what episode she was in, nor what her name was. She looked like Amethyst Star, but with a slightly neater tail and was more blue than purple. Her cutiemark was two dolphins circling each other like a yin yang.

"Who a-are you?" She asked me. It was obvious that she was less scared of me than the others, but I can't entirely blame them all for being scared. Most of them didn't even know what a zebra was until Zecora came around, and now they see an alien that's two times taller than all of them.

"My name is Mathew Heart, what's your name?" I asked in kind, trying to be polite.

"Sea Sworl- I mean Swirl! Sea Swirl! Sorry, I'm very intimidated right now." She quickly spit out, smiling nervously.

"Well, I don't entirely blame you, Sea Swole, I'm a tall guy." I chuckle, lightening the conversation. All I gained for my efforts with that was a nervous chuckle back.

"So, what brings you to Ponyville?" She asked, visibly becoming more comfortable with my presence. It took me a moment to think of what to say. I couldn't exactly tell her I wanted to know what year it was. Even if she didn't think I was crazy, she would probably start asking a bunch of questions about the future.

"It was just the closest place I could find. If you couldn't tell, I'm not from around here."

"No kidding." She raised an eyebrow. It was at this point I realized I was successfully having a normal conversation with someone. Said someone might be a cartoon pony, but still, I probably would have said something either stupid or mean by now. Deciding not to think on it to much, I reply to her with my guilt card.

"Yep, I'm far from home, and I don't think I could get back there if I wanted to." I felt bad using the guilt card, but I also felt it was necessary. "I'm pretty much homeless now." I finished, closing my eyes and shrugging softly with a smile.

"You're homeless?" I nodded to her question. "That's so sad!" She exclaimed, clearly taking pity on me. Better to be pitied than feared, I guess. I'll take what I can get, which probably isn't a lot.

"Yeah, it is." I simply said. After that was an uncomfortable silence, me just sitting on the bench with a pony staring at me with sad eyes. If sadness could be weaponized, then this sadness would overpower the ban hammer. This wasn't your average everyday sadness, this was advanced sadness. Eventually though, she sat down beside me on the bench.

"I'm sure things will get better."

The silence was a little more comfortable after that.

SWEP:Deploy()

View Online

After a few more minutes of silence, Sea Swirl let me know that she had somewhere to be.

"I'll make sure to put in good word of you, alright?" She said reassuringly. I just nodded and stayed sat on the bench, while she left to go do whatever she needed to do. While I was by my self now, I decided to test more of my coding abilities, since I had a lot of free time now. Opening up Notepad, begin my coding with something I've made before, a SWEP for Garry's Mod that I had yet to fully touch up. I had already gotten past the how-do-I-make-it-do-what-I-want phase, I just had to rewrite the code. It wasn't anything advanced, but I definitely had trouble getting it to work the way I wanted it to at first, it was one of my first SWEPs after all. Once I had figured out how though, it wasn't too hard to get the rest. I knew the basic SWEP structure, so I was able to get most of that down, but then came the fun part. What actually happens when you click.

function SWEP:PrimaryAttack()
. local ply = self:GetOwner()
. ply:SetPos(ply:GetPos() + ply:GetAimVector() * 10)
. timer.Create( "phasethrough", 0.015, 0, function()
. . ply:SetPos(ply:GetPos() + ply:GetAimVector() * 10)
. end)
. timer.Create( "checkifinworld", 0.25, 0, function()
. . if (ply:IsInWorld()) then
. . . timer.Remove("phasethrough")
. . end
. end)
end

I couldn't remember if this was how you do it correctly, but what it's supposed to do is find where I am and which way I'm looking. Once it does that, then it teleports me ten units in the direction I'm facing, which is really only about ten inches, and then, every forth of a second, it checks if I've gotten stuck in a wall. If I'm not stuck in a wall, then it wont to anything else, but if I am in a wall, it will continue to teleport me ten units in the direction I'm looking every zero-point-zero-one-five seconds until I'm no longer in a wall. To put it simply, I can slide through anything solid when I left-click.

I save the script as 'weapon_phase.lua', before opening another Notepad window and typing another simple command.

Entity( 1 ):Give( "weapon_phase" )

This command should give me the weapon I just scripted. Pretty simple. Saving that as well, I run the script and close all the tabs. Once again, I couldn't tell any difference after using a command, but this time it was because I set the weapon model and hold type to none instead of something like a pistol, making the weapon seem like a part of me. The weapon was less of a weapon now and more of an ability I had. I just have to figure out how to left-click in real life.

"Hey! I'm talking to you!" A sudden voice yelled in my face, startling me from my thoughts. After my little jump, I looked around in both directions and realized that I had started pacing around town during my internal self exposition. I was next to Sugarcube Corner now. Turning back to the voice, I see Rainbow Dash herself giving me the stink eye. She was flying just to meet me at eye level, which was kind of a funny thought.

"What gives!? Why are you scaring everypony left and right!?" She yelled in my face again, looking very mad.

"Hey, don't blame me, I haven't even done anything!" I semi-yell back, actually getting a little upset.

"Yeah, not yet! You need to leave." She said, jabbing a hoof against my chest.

Now, let's real talk for a moment. I can take pranks, I can take criticism, I can take insults, and much, much more. What I can't take is anything physical. Even when it's unintentional, I still get a bit mad, but I keep it to myself. If someone purposely shoves me, or smacks me, or anything, I can sometimes blow up. I already knew this was going to be a test of my will. I had to refrain from getting physical myself, or everyone would think I'm bad. Still, I glared at Dash.

"Why should I have to leave?" I start, trying my best to keep a calm voice. "I haven't done anything wrong, and no one has given me a chance to do something right. If you want me to leave, you'll have to make me."

"Good."

"What?"

"Now, Applejack!"

A lasso had been thrown over me from behind and it tightened around my feet, tripping me forward and stopping me from moving them. Once I had fully fallen to the ground, I was very upset, and I felt like I had a right to be. I was just trying to be nice and they tie me up! I should fight back! I try to lift myself off the ground, but I couldn't stand fully with the lasso wrapped around me and a giant skittles bag sitting on my back. These ponies must have been heavier than they looked. That didn't stop me from struggling though. I could barely lift myself up at all, I was stuck face down.

"Good work distractin' em' Dash." Applejack said, holding out her hoof.

"Pshh, I did most of the work." Rainbow dash replied, hoof-bumping Applejack's hoof anyways. I almost couldn't believe it. I was in Equestria with super powers and the good guys tied me up!? Why!? I've done nothing! I just wanted to punch the ground and have it give way like cardboard.

Wait a moment.

The SWEP I gave myself, could I use it to get out of this? I didn't know how to left-click, but maybe I didn't need to. It's not like it's always bound to left-click, the button is changeable. The thing that's consistent is that it's an attack that activates it. If I'm right, then all I have to do is punch the ground! I tried my hardest to lift my arm, and Rainbow apparently saw this as a good opportunity to taunt me.

"Sorry pal, you're not going to be able to pull me off, I'm too awesome!"

"That's not what I'm going for." I say, dropping my fist onto the ground beside me.

Immediately, I began to sink into the ground. After a few seconds I change the direction of my travel by tilting my head forward instead of down, going in the direction of my vision. I couldn't tell where I was going very well, but I'm sure if I go back up after about a minute I should be golden-

Since I couldn't tell where I was headed, I ended up going in the direction of Sugarcube Corner, or more accurately, underneath it. Lifting myself off the ground I landed on after I exited the wall, heard giggling up ahead.

I could tell I was in for a doozy.

partyplan.lua

View Online

So there I was, inside of the Party Cave with Pinkie Pie right in front of me facing the other way. I wasn't going to get out of this without a party, was I? Seeing the Party Cave in person was kind of jarring to me, not because it had more party supplies than I've ever seen in one place, but simply because of how much food was stored here on the shelves. Wouldn't all of those cupcakes get old? Or does she constantly cook more and throw out the old ones? I really had no idea, but this was Pinkie Pie we're talking about, so I tried to stop thinking about it too much. I began to sneak to the side where I saw the slide, the only exit I could see, hoping that I wouldn't be detected. I know detection is an inevitability when Pinkie Pie's around, but I still hoped.

"Gummy, that's so silly! You just crack me up!" Pinkie said, followed by more giggling. "Anyways, my back is itchy, and you know what that means!" She paused, and I don't know if it was for a response or for dramatic effect. "It means it's my lucky day! And with how often a lucky day for me means meeting a new pony, that means there's about a eighty percent chance I'll make a new friend today!"

Well, there goes any hope I had. There was no way that it didn't mean me, and that was a just about a fact. Didn't mean I stopped trying to sneak with my back against the wall. I continued to shimmy myself to the right, towards the slide. Then her tail twitched.

"Twitchy tail!"

Immediately, I stepped on an unseen pencil and fell forward to where Pinkie was standing, while Pinkie dove under a table because of her Pinkie Sense. Fate was definitely not siding with me today. With a loud thud and an oomph, I scramble to try to lift myself up. My cover was blown. It didn't even matter if I used my SWEP to leave now, her Pinkie Sense already decided my fate. When she turned around and gasped, I just accepted what was going to happen, and slowly lifted myself into a cross legged sitting position.

"New friend! I knew it!" She exclaimed loudly, suddenly pulling me into a hug. I was definitely not used to her presence, so I just pat her on the head a little bit uncomfortably. I prepared myself for the list of questions she was going to ask.

"Hi, I'm Pinkie Pie! What's your name? What's your favorite food? What's your favorite drink? What's your favorite balloon color? What flavor of cake do you want? Do you like parties? When is your birthday? What are you? Are you an alien?" Surprisingly, she didn't ask her questions at a non-intelligible pace. It was still fast, but also understandable.

"I'm just going to answer your questions in order. Mathew Heart, cheese coneys, cherry Coca-Cola, red balloons, chocolate, yes, June twentieth, human, and yes." I answered, actually smiling a bit at the absurdity of my situation.

"Neat! It's nice to meet you! Can I call you Mathy?" She asked, looking up at me. I wasn't opposed to the nickname, so I nodded. After I did, she hopped off, pulled a folder full of paper out of her mane, and began writing intensely, using the pencil I tripped on. I knew I wasn't going to get away while she was writing, so I stayed put and waited patiently. After a few more seconds, she looked back at me, and walked around me in a circle, before going back at the paper. I assumed she was actually drawing me now.

"Almost done! I just need to know what a Coca-Cola is." She said, looking at me once more.

"It's a soda."

"Thanks!" She quickly wrote it down, and put the new folder in a nearby file cabinet. "Alright! Lets head upstairs." She started to drag me by the back of my shirt, and I decided to voice my complaints.

"Hey! Don't drag me, I have legs! Also, I don't think going upstairs is a good idea."

"Why?" She stopped pulling.

"Because everyone is scared of me, on account of the fact that I'm an alien!" I explained.

"Don't be silly, as soon as they see that you're nice to me, they wont be scared at all! Besides, I can't throw a party in my Party Cave, that would be ridiculous!" I opened my mouth, but then closed it. She might have a point. Everyone in town trusts her, right? As long as I don't make any sudden moves to startle anyone, that means this could actually work.

"Alright, you convinced me." I say. "Just give me a bit of time to prepare myself."

"Sure thing! Come on Gummy!" She said, picking up Gummy and walking up the slide with just her hind legs. Now, I wasn't going to do this without a backup plan, so I opened Notepad and began to write two separate codes. Both of them would be SWEPs, so I first wrote down the basic SWEP stuff, then I wrote what I want the SWEPS to do when I use them.

function SWEP:Deploy()
. Print( "--------------------" )
. local ply = self:GetOwner()
. local tr = util.QuickTrace(ply:EyePos(), ply:EyePos + ply:GetAimVector() * ( 12 * 10 ), ply)
. PrintTable(tr)
end

This code should simply allow me to get information about what I'm looking at when I change to this SWEP as long as I'm within ten feet. I'm hoping it'll tell me information about ponies, instead of obvious stuff like if it's a pony or not. Saving the code as 'weapon_info.lua', I use another quick command to give it to myself, and this time I could tell the difference. It seems that because I have more than one SWEP now, I've gained a hud at the top of my vision to switch which one I'm using. I tested changing it with my mind, and it seemed to work fine. Then I quickly wrote another code.

function SWEP:Deploy()
. local ply = self:GetOwner()
. local tr = util.TraceHull({
. . start = ply:EyePos(),
. . endpos = ply:EyePos() + ply:GetAimVector() * (12 * 100),
. . filter = ply,
. . mins = Vector(-1, -1, -1),
. . maxs = Vector(1, 1, 1)
. })
. if (tr.hitworld) then
. . ply:SetPos(tr.HitPos)
. end
end

What this SWEP should do is when I select it, it will teleport me to where I'm looking, with a maximum range of one-hundred feet, and only works if where I'm looking is the ground or a wall. Don't want to end up a mile in the air, now do I? This will be my escape plan if things turn sour. I save the code as 'weapon_telescape.lua' and give it to myself. Now, relaxed at finishing some coding stuff, I think I'm finally ready for a party.

"Here we go."

ESC

View Online

"Pinkie! I'm ready!" I called out as I stood and looked up, lifting my hand with my call. I had a plan, and a way to abort the plan, so that was good. To quote someone else, 'make the plan, execute the plan, expect the plan to go off the rails, throw away the plan'. I felt like that was some okay advice. After standing there for nearly a minute, I call out Pinkie's name again, this time holding both hands up. Knowing Pinkie Pie, she'll probably wait until I don't expect her to show up before she actually shows up. That or she was waiting for me to leave just to shout surprise. With a shrug, I walk up to the slide and slowly climb my way up.

As I opened up the trap door, I heard voices talking nearby. I couldn't make it out very well, so they were probably outside the room I was entering. I bet they were waiting for me. Closing the trap door back up, I was now inside Pinkie Pie's room, and outside should be a staircase I think? I don't remember the layout of this bakery very well. I'm pretty sure I somehow went from the Party Cave, which is under the bakery, to Pinkie's room, which is on the third floor. I've fiddled around with Portal 2 map making before, so I can just think of it as 'linked_portal_doors' and be on my way before my brain collapses in on itself.

I listen in by the door, and to my surprise it's not a happy situation. Apparently, before Pinkie Pie had the chance to even start party planning, Rainbow Dash and Applejack had arrived, and dragged Twilight with them to try to catch me, and were telling Pinkie Pie that I'm super dangerous and everything. I hadn't planned for this, so I sneaked away from the door, and hid myself behind Pinkie's couch. Opening Notepad, I begin to think real hard. I need a way to negate telekinesis if I want to escape. If I just run now, I'll be caught faster than Pinkie could eat a banana sundae with a cherry on top. I don't know if I'll be able to teleport out of telekinesis, and my phase SWEP would be useless, because I wouldn't be able to attack from being frozen in place.

Wait, that's it! I throw open the Garry's Mod Wiki and check two simple commands. I already know how to make traces, I just need to figure out how to hit myself with one. I keep filtering myself out, so what if I just didn't? Ooh, I have an even better idea now, and I don't even need to hit myself with a trace! I began my script. Basic SWEP stuff, blah blah blah.

function SWEP:Think()
. local ply = self:GetOwner()
. if (ply:Freeze(true)) then
. . ply:Freeze(false)
. end
end

What this should do is make it so the moment I'm ever frozen, I'll immediately be unfrozen. It's very simple, and will be very useful if it works. Now for the other part.

function SWEP:PrimaryAttack()
. local ply = self:GetOwner()
. local stpos = ply:GetShootPos()
. local enpos = stpos + ply:GetAimVector() * 50000
. local tr = util.TraceHull({
. . start = stpos,
. . endpos = enpos,
. . filter = ply,
. . mask = MASK_SHOT,
. . mins = Vector(-24, -24, -24),
. . maxs = Vector(24, 24, 24)
. })
. local ent = tr.Entity()
. if (IsValid(ent)) then
. . ent:SetVelocity(Vector(0, 0, 0))
. end
end

What this code should do is make it so anything I attack towards will lose all velocity and will have to regain it. I'm hoping this will be able to stop Rainbow Dash, or at least pause her if she starts chasing me. Saving both codes in the same SWEP as 'weapon_antifreeze', I run the command to give it to myself, and I walk out from behind the couch. Sneaking close to the door again, I look through the key hole. Oh no, now Pinkie Pie looks conflicted, and I can tell she doesn't want to go against her friends. I need to get past them quickly. This door is the only exit other than the window, and I'm not jumping out a window on the third floor of a building. I have something they don't right now though.

The element of surprise.

"LOUD BANG!" I yelled as I kicked the door in, immediately booking it past them. They all jumped at the noise, but Rainbow Dash was the first to start chasing me. As soon as she was flying right behind me, which was no time at all, I swung my arm in her direction like I was backhanding a fly. Despite not connecting my hand, Rainbow Dash still lost all forward momentum and fell to the floor. Exactly as I had planned.

"What the!?" She said, lifting herself back up. Rainbow Dash saying this seemed to get Twilight to snap out of her surprised stupor, and she lit her horn right a second too late, as I was already running down the stairs and out of sight. Applejack jumped down the stairs after me, jumped I say! She had her lasso, and she swung it right at me. I switched weapons to the phase SWEP again, and phased through the rope, and also the floor I was on, landing me on the first floor. I somehow landed upright and on my feet, so I quickly spun in a circle and spotted the door, with Twilight blocking it. I guess she teleported.

Switching back to my antifreeze SWEP, I ran towards her while moving my arm in front of me during my charge. She lit her horn and I felt the magical aura surround me. It didn't do anything but assault my ears a bit from being so close. Not stopping for anything, not even magic, I dive over Twilight's head, and land myself outside with a roll. Taking a sharp left because that way seemed more open, I see Rainbow Dash flying out the window of the third floor, before diving towards me at about a fourty-five degree angle. I swing towards her again, making her fall straight down at the loss of her velocity.

I was in the clear now! I switched to my telescape SWEP, and-

Something is creating script errors.

...What?

I open the console, not Notepad, and I quickly read what happened. Apparently I used a trace hull without giving it a mask enumeration. I'll need to fix that when I get the chance. Closing the console, I continue my sprint. I couldn't distract myself too much, if I open Notepad to change my speed, I could end up tripping or running into a wall, and I really didn't want to end up eating dirt. It hurts more than it looks. Finally making my way out of town, it seems that they all gave up on chasing me.

Wait.

That was their plan! They weren't trying to catch me, they were trying to make me leave! I did exactly what they wanted me to! Gosh darn it! You know what? Fine, I don't need to be in Ponyville. I just needed to know if I when I was, and now I know I'm before the end of season three because Twilight wasn't an alicorn. If Ponyville doesn't want me, I'll try somewhere else. What are the friendliest places I know of? I wouldn't go to Canterlot, Zecora's hut, or anywhere like that. Manehatten might be completely uncaring, but not exactly friendly either. Think, Mathew, think!

Where do I go from here?

connection failed after 6 retries.

View Online

I simply don't know where to go, not that there are many options really. I just sat still for a few minutes to think, but I couldn't figure out anywhere I would want to go. I can't go back into Ponyville, obviously, and just about anywhere else around here would probably be worse, I.E. Canterlot, Manehatten, et cetera. They would just be rude to me too, possibly even more so! I also wont be able to go to Griffonstone or the Dragon Lands, because of similar reasons. Both griffons AND dragons are moody, greedy, and just mean in general, and I don't want to go anywhere with people like that.

Not that I could get there anyways. Like, I could probably sneak my way onto a train to Griffonstone if I wanted to, but I don't. Also, according to the map I saw, the dragon lands are over seas, and I don't have a way to travel across water. I can increase my run speed if I wanted to go anywhere else, but I can't go too fast with that without risk, and my teleport SWEP is fixed now but I need to see where I'm going in order to use it. If only I could just use noclip.

Wait a second.

Without another thought, I open notepad once more and start my SWEP coding routine. Blah Blah Blah important bits:

function SWEP:Think()
. local ply = self:GetOwner()
. local vel = ply:GetVelocity()
. ply:SetGravity( .001 )
. ply:SetVelocity( ply:GetVelocity() * -1 )
. if ( ply:KeyDown( IN_FORWARD )) then
. . ply:SetVelocity( vel * -1 + ply:GetAimVector() * 500 )
. elseif ( ply:KeyDown( IN_BACK )) then
. . ply:SetVelocity( vel * -1 + ply:GetAimVector() * -500 )
. elseif ( ply:KeyDown( IN_RIGHT )) then
. . ply:SetVelocity( vel * -1 + ply:GetRight() * 500 )
. elseif ( ply:KeyDown( IN_LEFT )) then
. . ply:SetVelocity( vel * -1 + ply:GetRight() * -500 )
. end
end

What this should do is allow me to use movement very similar to noclip, without the going through walls part, so it's just simple directional flight. I should be able to hover in the air, and move just above my default running speed. Oh, and I also need to make sure to re-enable gravity when I put it away!

function SWEP:Holster()
. local ply = self:GetOwner()
. ply:SetGravity( 1 )
. return true
end

Perfect, now I just need to save and test it. Saving it as 'weapon_noclip.lua' and giving it to myself, I look up and try to move forward.

"NOPE! NOPE! NUH UH! NADDA! NO WAY JOSE! DON'T WANT NONE OF THAT!" I begin to panic as my feet leave the ground. I know I would be fine, but hey, anyone would freak out if they started floating too. I quickly put away the SWEP and my feet firmly plant themselves back on the ground. Oh jeez I'm wheezing now, jeez jeez jeez.

"Oh boy, okay, wow." I say as I finally begin to calm down. Well that was terrifying, and I'm never going to do it again unless it's an absolute emergency, but I still haven't solved my problem on where to go, I'm just able to fly now. Just freaking great. At this point I might as well try to go somewhere completely impossible to get to, like Canterlot High, or something. Well actually, given my power set it might actually be pretty easy to get there, but I kind of don't want to.

You know what? I'm going back to Ponyville. I don't care if they want me to leave, I'll just stay. It's not like they can really do much about it. They'll get used to me eventually, right? I really don't have anywhere to go, might as well go where everything is at least familiar. I just need to do a few things first, this time not making it a SWEP.

function GM:ScalePlayerDamage( ply, hitgroup, dmginfo )
. local allplayers = players.GetAll()
. for id, player in pairs( allplayers ) do
. . if ( player:Nick() == "Mathew Heart" ) then
. . . dmginfo:ScaleDamage( 0.01 )
. . else return end
. end
end

Now, what this should do is make me nearly invincible. If anyone else just happens to have my name though, they'll be near invincible too, but I doubt anyone in Equestria has my name. I run the code through the console, and now I just need to find a way to test it. I suppose the best way to test it is go back into town, and see if I can get anyone to punch me, which shouldn't be hard if I talk to Rainbow Dash. I might not like physical violence, but this is for testing purposes.

Slowly making my way BACK into town, I decide to come up with a backup plan too. A SWEP that can be used to disguise me, and allow me to get away if I need to hide.

local plymodel = nil

function SWEP:Deploy()
. local ply = self:GetOwner()
. plymodel = ply:GetModel()
end

function SWEP:PrimaryAttack()
. local ply = self:GetOwner()
. local tr = ply:GetEyeTrace()
. if ( IsValid( tr.Entity ) && IsValid( tr.Entity:GetModel() ) ) then
. . ply:SetModel( tr.Entity:GetModel() ) )
. end
. self:SetNextPrimaryFire( CurTime() + 1 )
end

function SWEP:SecondaryAttack()
. local ply = self:GetOwner()
. ply:SetModel( plymodel )
end

function SWEP:Holster()
. local ply = self:GetOwner()
. if ( ply:GetModel() == plymodel ) then return true
. else return false
end

What this should do is allow me to turn into anyone or anything I'm looking at, but I cant use any other SWEPs while transformed. I'll need to figure out how to use primary and secondary attacks without swinging sometime soon, but for now it will have to do. At this point I realized that I was walking while coding, and was already right outside of town, but this time I'm possibly way more resilient to all damage, and I can possibly shape shift.

I'm starting to think that I might be somewhat... over powered.