2DWorlds Forums
Fly Tool - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: Fly Tool (/showthread.php?tid=1088)



Fly Tool - Jacob__mybb_import1 - 10-17-2010

Put this script in a tool, then hold down the mouse button to fly.

Code:
tool = script.Parent
player = tool.Parent.Parent
if player:isA("Player") then
    controller = player.Character.Body.Controller

link(script.Parent.MouseDown, function(button, point)
    controller.Velocity = Vec2D(controller.Velocity.x, 5)
end)

link(script.Parent.MouseUp, function(button)
    controller.Velocity = Vec2D(controller.Velocity.x, 0)
end)

end