The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5327 - File: inc/functions.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions.php 5327 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.4.12 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



2DWorlds Forums
Gravity Tool - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: Your Stuff (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=6)
+--- Forum: Current Games (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=11)
+--- Thread: Gravity Tool (/showthread.php?tid=2037)



Gravity Tool - Jacob__mybb_import1 - 04-04-2011

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!


RE: Gravity Tool - Scripter - 04-04-2011

I didn't quite get some of the things used in the while do loop, but oh well.

Thanks!


RE: Gravity Tool - Login - 04-04-2011

Jacob_ I will, gladly. ^_^ I'll make it on my last place.


RE: Gravity Tool - BuildistGuard - 04-04-2011

I will put that in my future arena.


RE: Gravity Tool - Micky - 04-10-2011

So thats what you used for the heli!!


RE: Gravity Tool - Ashely - 04-10-2011

I tried it out, Thanks!