• Published 7th Aug 2019
  • 4,510 Views, 48 Comments

Scripting Equestria - Wild Wire



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

  • ...
4
 48
 4,510

connection failed after 6 retries.

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.

Author's Note:

Okay so apparently forgetting a mask enumeration DOESN'T actually cause a script error, so I guess I lose ten points for my inaccuracy.

I have only tested the FIRST SWEP in this chapter, so I am unsure if the others will work, but hey, better than nothing... I think?

Also, I couldn't find a reason for the main character to go anywhere other than back to Ponyville, so I'm sorry for possibly getting your hopes up of seeing other places like Zebrica or something. I'm also sorry for this chapter probably being more code than story, but I find coding to be enjoyable at times.

Lastly, here's that map I keep referring too. If there will be any more location traveling, its going according to this map here.

Comments ( 14 )

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.

He should try snapping hit fingers or imagine clicking buttons

Why was he chased out of the town again? Just for being there, right?

Why didn’t he just go to Canterlot and no-Clip his way to an audience with Celestia? He has done nothing wrong to warrant her attacking him after all!

make him go to celestia or luna it will be better man and so much more cooler and can you make them longer? i dont really care if it take more time quality firts man :) i love the story

When do you think the next chapter is out?

This story has potential, keep it up! Also, are you familiar with the mod https://bit.ly/2IuCS9O ? He could potentially code that or the normal playermodel menu into his notepad and use it to his advantage later on. If it serms too op it could be used to just change what clothes he is wearing. For example he could use it to change his casual clothing into a smart suit.

Damnit you just gotta hate racist ponies, especially when they are so cute! but don't worry good story so far, looking forward to more in the future!

tk4

Wouldn't it be better to use the player's entity id to check whether the damage scale condition is applied rather than name? Not that it would matter I suppose if there really wasn't anyone else named the same. I just figure it would be far more secure and logical to use for practically the same amount of work put in, haha

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.

Your name? Why not use your player entity ID? I see two ways for this to work.
Method#1
Instead of putting
". . if ( player:Nick() == "Mathew Heart" ) then"
Just use your entity instead.

Method#2
IF that doesn't work then do something like this

  • Something here to make the variable Name into a string so the code doesn't think that its supposed to be a number. Idk might be a wire mod expression two only thing.
  • enetity(1) = Name

And then Instead of putting your name, You do

  • if ( player:Nick() == Name ) then

This way it will be using a variable set to your entity. This will stop anypony with the same name from getting basically god mode.


Again I haven't use lua in months and I rarely use entities so correct me if I'm wrong. Also, why did I do this? because I know that your probably going add someone in the story that has the same name thus the same god mod. this would stop that.

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.

Prop hunt:rainbowlaugh::trollestia:

Awe...
Man it would be nice if they just befriended your ture Human self instead of your fake self

Uh-oh, we have a Lua Uppercase Accident!

Lua is not an acronym, rather it is a name, meaning "Moon."

Now I am going to read this story and harshly judge all of the lua code I find.

Hmm, does Garry's mod allow && in place of and? One of the last codeblocks here have that.

Also, missing end for that last function's if.

I've not used Garry's Mod's Lua before, but it looks like it has a lot of helper functions built in a way that is intuitive to use.

Login or register to comment