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
*/