Gravity Tool
#1
Put this script in a tool:

[lua]
force = 0
target = nil
strength = 5
run = false

function mouseDown(b, pos)
if b == 3 then
force = strength
elseif b == 1 then
force = -strength
end
target = pos
run = true
end

link(script.Parent.MouseDragged, function(b, pos)
mouseDown(b, pos)
end)

link(script.Parent.MouseDown, function(b, pos)
mouseDown(b, pos)
end)

link(script.Parent.MouseUp, function(pos)
force = 0
run = false
end)


while true do
if run and force ~= 0 then
local c = game.World:getChildren()
for i=1, #c do
if (c[i]:isA("Box") or c[i]:isA("Circle")) and c[i].Fixed == false then
d = c[i].PositionConfusedub(target).normalized
c[i].Velocity = d:mul(force)
end
end
end
sleep(0.1)
end
[/lua]

Left click to make black holes, right click to make white holes.

Feel free to make a game with this!
Reply
#2
I didn't quite get some of the things used in the while do loop, but oh well.

Thanks!
[Image: rogershanksluffy_display.gif]
Reply
#3
Jacob_ I will, gladly. ^_^ I'll make it on my last place.
[Image: poptartFINALTINY.gif]
[Image: log.png?t=1302647037]
Reply
#4
I will put that in my future arena.
[Image: 1te6tmtu01m.png]
the dogs will take over these countries.
Reply
#5
So thats what you used for the heli!!
Reply
#6
I tried it out, Thanks!
Hello
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)