Last visit was: It is currently Sun Sep 05, 2010 7:52 am


All times are UTC + 10 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [LUA] Utility - Keep people away from you.
PostPosted: Sun Jul 04, 2010 11:02 pm 
PubNub

Joined: Sat Jul 03, 2010 10:24 pm
Posts: 24
A script used to keep people away from you. Basically, when someone gets close to the person whos steamid is in the script and the concommand is toggled on, then it pushes that person who gets close away in a random direction. It's in beta and thats v1.2. It's not the most efficient but thats the way i worked out how to get it right.
This is COMPLETELY myne. I coded this from scratch, but Ice Dragon/Jesus wanted me to make it for him (even though he banned me from his server). So i decided to release it.
Put the script in garrysmod/garrysmod/lua/autorun/server/scriptname.lua

[size=140]
Also note, put you're steamid in the quotations below. It should be
Code:
mysteam="Steam:0:0"

in that format.


Code:
mysteam="" -- Put you're steamid here.
if !Me:SteamID()==mysteam then
for _,i in pairs(player.GetAll()) do
if i:SteamID()==mysteam then
Me=i
end
end
end

function MovePlayer()
for k,v in ipairs(ents.FindByClass("player")) do
if v:GetPos():Distance(Me:GetPos())<500 and v!=Me and stoppeople==true and v:IsAdmin()==false and v:IsUserGroup("mod")==false and v:IsUserGroup("moderator")==false then
v:SetVelocity(Vector(math.Rand(-500,500),math.Rand(-500,500),math.Rand(-500,500)))
v:SetMoveType(MOVETYPE_WALK)
end
end
end
hook.Add("Think","checkforthinking",MovePlayer)

concommand.Add("Togglenoonenearoundme", function(ply,cmd,args) if ply:IsAdmin() then stoppeople=!stoppeople end end)
-- Use Togglenoonearoundme in console to make it push people away when they get close.

/* Concept by ownage
Credits to Jesus/Ice Dragon(who is a douche) for
making me make this
*/

_________________
My First Sig.
Image


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
© PubGamer.org | Design by StudioPaw | Terms Of Use