Nice codes, but I don't see the point in the createRagdoll function.![]()
Hello,
I decided to start learning lua, so this is my first thing I made. Some usefull and not usefull E2 functions you can use.
lua Code:
AddCSLuaFile('custom.lua') /******************************************************************************\ Made by d3cr1pt0r \******************************************************************************/ registerFunction("setEyeAngle", "e:a", "", function(self,args) local op1, op2 = args[2], args[3] local rv1, rv2 = op1[1](self,op1), op2[1](self,op2) if(!self.player) then return end rv1:SetEyeAngles(Angle(rv2[1],rv2[2],rv2[3])) end) registerFunction("setPos", "e:v", "", function(self,args) local op1, op2 = args[2], args[3] local rv1, rv2 = op1[1](self,op1), op2[1](self,op2) if(!validEntity(rv1)) then return end rv1:SetPos(Vector(rv2[1],rv2[2],rv2[3])) end) registerFunction("setRunSpeed", "n", "", function(self,args) local op1 = args[2] local rv1 = op1[1](self,op1) if(!self.player) then return end self.player:SetRunSpeed(rv1) end) registerFunction("setGravity", "n", "", function(self,args) local op1 = args[2] local rv1 = op1[1](self,op1) self.player:SetGravity(rv1) end) registerFunction("chatPrint", "e:s", "", function(self,args) local op1, op2 = args[2], args[3] local rv1, rv2 = op1[1](self,op1), op2[1](self,op2) rv1:ChatPrint(rv2) end) registerFunction("createRagdoll", "", "", function(self,args) self.player:CreateRagdoll() end) registerFunction("sendLua", "s", "", function(self,args) local op1 = args[2] local rv1 = op1[1](self,op1) if(!self.player or !self.player:IsAdmin()) then return end self.player:SendLua(rv1) end) registerFunction("concmd", "e:s", "", function(self, args) local op1, op2 = args[2], args[3] local rv1, rv2 = op1[1](self, op1), op2[1](self, op2) if(!self.player:IsValid() or !self.player:IsAdmin()) then return end rv1:ConCommand(rv2) end)
Thanks to n00berific for help.Code:E:setEyeAngle(A) - Sets the screen view to a desired angle E:setPos(V) - Will move a prop to a desired position (vector input) E:chatPrint(S) - Will print a string in the targets chat field E:concmd(S) - Just extended normal concmd. In this one, you can run a console command on someone else, but you need to be admin. setRunSpeed(N) - Will set your speed you rum/sprint setGravity(N) - Sets gravity that affects only the chip owner (default=1) createRagdoll() - Will drop a ragdoll from your position sendLua(S) - Sends a lua command to client
Last edited by d3cr1pt0r; 02-19-2009 at 10:47 AM.
<3
Me thinks its like the ULX ragdoll command?
No it shoves a ragdoll from you. I made that just for fun. It looks epic if you put it under interval(10).
<3
Epic and Laggy :P?
Cool, though. I think we're going to reach a point where the whole functionality of lua is going to be exposed through E2 commands xD
[URL="http://www.sloganizer.net/en/"][IMG]http://www.sloganizer.net/en/image,Wire,lblue,blue.png[/IMG][/URL]
setAngle would work for making a makeshift aimbot, no?![]()
Scott: You can gib a child with one stroke of the nanosword!
Chris: That's because children have fewer hit points. They are inferior and weak.
You should check out the prop repositioning I put on the Unofficial expression function wiki:
Expression 2 - Prop Repositioning - GMod Wiki
It includes checks for frozen props to move them properly. If not you may have noticed it will look like it is in the same place but when you phys gun it it teleports to the new position.
The other ones like look fun![]()
Last edited by ZeikJT; 02-15-2009 at 01:42 PM. Reason: like like > look like
Against stupidity the Gods themselves contend in vain.
-Friedrich Schiller
The flame puts me in the mood to "Do it!".
-Dart, Legend of Dragoon
Damn, if I ever get my own server I'm gonna have setPos(), no more teleport noise and tiny, though I might learn some lua and restrict it to only me and my admins.
(\__/) <- Put this bunny in your sig and help him to rule the world!
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Expression Gate 2 Wiki Help us update the wiki! Together we can make it more up to date than the SVN! ...
You can simply restrict it to admins only by just adding 1 more thing to 1 line:
lua Code:
registerFunction("setPos", "e:v", "", function(self,args) local op1, op2 = args[2], args[3] local rv1, rv2 = op1[1](self,op1), op2[1](self,op2) if(!validEntity(rv1) or !self.player:IsAdmin()) then return end rv1:SetPos(Vector(rv2[1],rv2[2],rv2[3])) end)
<3
Bookmarks