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 1 - Line: 1474 - File: inc/functions.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
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
2/4/11 - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: News (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=8)
+--- Thread: 2/4/11 (/showthread.php?tid=1262)



2/4/11 - Jacob__mybb_import1 - 02-05-2011

  • Tool picking up/dropping works again, and
  • Tools are now dropped where you are pointing instead of on your head
  • getAngle() member function for tools; this returns the angle between the player's body and the mouse
  • moveTo(position, part) member function for models. The specified part will be moved to the given position, and the other parts in the model will be moved with it.

Here is an example of getAngle(). Put this script in a tool, then click to throw balls.

Code:
player = script.Parent.Parent.Parent
character = player.Character
body = character.Body
link(script.Parent.MouseDown, function(b)
    if b == 1 then
        local a = math.rad(script.Parent:getAngle()) --it returns degrees, we need radians to use sin and cos
        local x = math.cos(a) --get the x and y components of the angle
        local y = math.sin(a)
        local position = Vec2D(body.Position.x + x * 4, body.Position.y + y * 4) --Position of the ball
        local p = create("Circle")
        p.Position = position
        p.Velocity = Vec2D(x * 20, y * 20) --Give it some velocity
        p.Color = Color(200, 0, 0)
        p.Parent = game.World
    end
end)



RE: 2/4/11 - ryan - 02-05-2011

Thats cool, thanks for sharing with us Jacob!


RE: 2/4/11 - Asai - 02-06-2011

God. The type of scripting on this site is CONFUSING!


RE: 2/4/11 - Jacob__mybb_import1 - 02-06-2011

Does this page make it any clearer? http://buildism.net/wiki/w/index.php?title=Scripting_Help


RE: 2/4/11 - Asai - 02-07-2011

(02-06-2011, 10:56 PM)Jacob_ Wrote: Does this page make it any clearer? http://buildism.net/wiki/w/index.php?title=Scripting_Help

Yes. Big Grin thanks Smile


RE: 2/4/11 - Jacob__mybb_import1 - 02-08-2011

Next update will be a tutorial of some sort.