User:HotThoth/Metascript Guide

From Legacy Roblox Wiki
Jump to navigationJump to search

Set-up

First, copy the source code of the metascript you want to use into a text file and save this text file somewhere on your computer.

Next, open up the level you want to edit in Roblox Studio, then go to Tools --> Execute Script, and select the text file you just saved.

Now, just enter the metascript command you want to use into the Command bar.

Commands:

NudgeScript

Allows for precise placement and orientation of models

   To “Nudge” the selected objects linearly by the vector (10, 20, 30):
   game.Lighting.Nudge.Value = Vector3.new(10, 20, 30)
   To rotate the selected objects by 10 degrees around the current axis of rotation through the objects' centroids(centers):
   game.Lighting.TiltAngle.Value = 10
   To change the current axis of rotation to be the z-axis for future rotations:
   game.Lighting.TiltAxis.Value = Vector3.new(0, 0, 1)
   To reset the orientation of selected objects to a canonical “un-rotated” orientation (to allow for alignment to absolute orientations and not just relative ones):
   game.Lighting.ResetOrientation.Value = true
   To remove the NudgeScript and its toggles and values from the level:
   game.Lighting.RemoveNudgeScript.Value = true


UtilScript

Allows for greater workspace control

   To find and select objects with the name “Right Arm”:
   game.Lighting.SearchForName.Value = “Right Arm”
   [Note:  Search currently doesn't look deeper into objects that already match the name--so it will not search for “Right Arm” among the children of an object named “Right Arm”]
   To print selected objects’ CFrames:
   game.Lighting.PrintCFrame.Value = true
   To cycle through selected objects, in order, repeatedly enter:
   game.Lighting.CycleThroughSelected.Value = true
   To cycle through selected object, in reverse order, repeatedly enter:
   game.Lighting.ReverseCycleThroughSelected.Value = true
   To remove UtilScript and all associated toggles and values from the level:
   game.Lighting.ClearUtils.Value = true

WeldScript

Allows for the creation and manipulation of welds

   To create a weld in the workspace, select two parts, enter the following, and follow the printed instructions:
   game.Lighting.MakeWeld.Value = true
   To find and select the Part0 associated with a weld, select the weld and then enter:
   game.Lighting.WeldSelectFirst.Value = true
   To find and select the Part1 associated with a weld, select the weld and then enter:
   game.Lighting.WeldSelectSecond.Value = true
   To print the C0 value of a weld, select it and then enter:
   game.Lighting.PrintC0.Value = true
   To print the C1 value of a weld, select it and then enter:
   game.Lighting.PrintC1.Value = true
   In order to preserve welds when “nudging” or translating objects, select all the welds you wish to preserve, and then enter:
   game.Lighting.EditWelds.Value = true
   [Note: calling game.Lighting.EditWelds.Value = true again may cause the first set of welds selected to not be preserved!]
   When finished with editing the parts, to reinstate the welds to be preserved, enter:
   game.Lighting.FinalizeWelds.Value = true
   To remove the weld script and all associated toggles and values (when done with weld tools):
   game.Lighting.RemoveWeldScript.Value = true