How do I create a magnetic resitance effect?

How do I create a magnetic resitance effect, so that when I walk near the prop it will try to move away from me. As if I we have the same polarity… if you know what I mean.

Is there an easy way to make this script? Has it been done before? If so where?

Thanks

[editline]21st November 2010[/editline]

Does nobody know? :frowning:

[lua]
local radius = 200
local force = 100

for k,v in pairs(ents.FindinSphere(ply:GetPos(),radius)) do

local dist = v:GetPos():Distance(ply:GetPos())

v:SetVelocity((v:GetPos()-ply:GetPos()):GetNormal()*force*(radius-dist)/radius)

end
[/lua]

Something like that.

thanks :slight_smile: