Name
|
Type
|
string
|
Description
|
The name of the object, which is often used to identify it in the context of its parent. Note that names are not unique identifiers; multiple children of an object may share the same name. In a script where you want to access an object using a name, for example, game.Workspace["Brick"], the first object found with that name is that object. This "first object" can be found in the Explorer menu.Names are great for showing a very brief title or summary of an object.
|
Member of
|
Instance
|
Parent
|
Type
|
Instance
|
Description
|
The hierarchical parent of the object. When no scripts hold references to an object, it will still be maintained as long as it's parent is set to an object which does have references to it, either by other objects or scripts. The toplevel DataModel object (the one referred to as the "game" by scripts) has no parent, but always has a reference held to it by the game engine, and exists for the duration of a session.
|
Member of
|
Instance
|
Archivable
|
Type
|
bool
|
Description
|
Sets whether or not the object is saved when publishing or saving to file. Also sets whether or not the object is clonable.
|
Member of
|
Instance
|
ClassName
|
Type
|
string
|
Description
|
A unique string per type of Instance. Should only be used as a unique identifier, as it does not reveal any information about nature of the type hierarchy the type is in. For this use, see IsA.
|
Member of
|
Instance
|
Anchored
|
Type
|
bool
|
Description
|
Sets whether or not the object is frozen in place.
|
Member of
|
BasePart
|
CanCollide
|
Property
|
Bool CanCollide
|
Description
|
If true, then the object will collide with other objects.
|
Member of
|
BasePart
|
Controller (Property)
Elasticity
|
Property
|
Number Elasticity
|
Description
|
Sets how much the object will rebound against another. a value of 1 is like a superball, and 0 is like a lead block.
|
Member of
|
BasePart
|
Friction
|
Property
|
Number Friction
|
Description
|
Sets how much friction the object has. A value of 1 is a no-slick grip, 0 is a waxy floor.
|
Member of
|
BasePart
|
Locked
|
Property
|
Bool Is Locked
|
Description
|
If True, the object will not be selectable.
|
Member of
|
BasePart
|
When used in 3D objects, such as Parts and other items, this property is a Vector3.
Position
|
Property
|
UDim2 Position
|
Description
|
Sets the position of the GUI object in object coordinates.
|
Member of
|
GuiObject
|
Note, the lowercase property operates differently. Rather than setting the location of an object, the lowercase position property specifies a goal location for that object.
Reflectance
|
Property
|
Number Reflectance
|
Description
|
Sets how reflective the object is. A value of 1 is like chrome, a value of 0 is a concrete wall.
|
Member of
|
BasePart
|
Shape
|
Property
|
PartType PartType
|
Description
|
Sets the type of shape the object has.
|
Member of
|
Part
|
When used in 3D objects, this property is a Vector3 representing how big, on each side, an object is.
Size
|
Property
|
Vector3 Size
|
Description
|
Sets the size of the object in object coordinates.
|
Member of
|
BasePart
|
|
When used in 2D GUI objects, this property is a UDim2 representing the size of an object.
Size
|
Property
|
UDim2 Size
|
Description
|
Sets the size of the GUI object in object coordinates.
|
Member of
|
GuiObject
|
|
In the fire or smoke object, Size is an Int.
Size
|
Property
|
Int Size
|
Description
|
Sets the size of flames or smoke based on an integer.
|
Member of
|
Fire, Smoke
|
Steer
|
Property
|
Number Direction to turn
|
Description
|
The direction of movement, tied to the keys A and D. Must be one of 1 (right), 0 (straight), or -1 (left). Will refresh back to 0 unless constantly set.
|
Member of
|
VehicleSeat
|
Throttle
|
Property
|
Number Direction to accelerate
|
Description
|
The direction of movement, tied to the keys W and S. Must be an integer 1 (forward) 0 (null) or -1 (reverse). Will refresh back to 0 unless constantly set.
|
Member of
|
VehicleSeat
|
There are two different Velocity properties:
Velocity
|
Type
|
Vector3
|
Description
|
Stores the speed and movement direction of the object.
|
Member of
|
BasePart
|
velocity
|
Type
|
Vector3
|
Description
|
Determines the constant directional force applied to the parent object.
|
Member of
|
BodyVelocity
|
AncestryChanged (Property)
Description
This event is triggered even a tool is equipped.
In a LocalScript:
Example
local function onEquipped(mouse)
mouse.KeyDown:connect(onKeyDown)
mouse.Button1Down.connect(function() onButton1Down(mouse) end)
end
tool.Equipped:connect(onEquipped)
Getting The Mouse Secretly
In one of your games you might want a player to have to click or press a key or something, but what if you don't want them to have to select a hopperbin or tool? One neat thing we can do with the tool is parent it into a player, and the equipped event will fire, giving us their mouse. Then we can do the clicking and pressing stuffs and delete the tool! Here's an example of a script that would get the mouse without them seeing anything:
Example
--This would go in the starterpack.
Player = script.Parent.Parent --Get the player.
Tool = Instance.new("Tool") --Create a tool.
Handle = Instance.new("Part",Tool) --Make a handle part so it will equip.
Handle.Name = "Handle" --Make sure it's called handle, or it won't work.
Tool.Equipped:connect(function(mouse) --When it's equipped fire a function.
Tool.Parent = nil --Delete the tool so they don't see anything.
mouse.KeyDown:connect(function(key) --When they press a key fire a function.
print(key) --Print the key they pressed.
end) --End the key function.
end) --End the equip function.
Tool.Parent = Player.Character --Parent it to the their character AFTER we have the equipped function ready so it will fire.
Now when the player presses a key it will print, and they didn't have to equip a tool or do anything!
Limitations
- Tool may equip before script add the connection, if both are added to Workspace on another machine.
- This event may not fire if the tool moves or removes before it reaches the right state.
Touched ( BasePart otherPart )
|
Description
|
Fired when another object comes in contact with this object.
|
Member of:
|
BasePart
|
LocalSimulationTouched ( Instance part )
|
Description
|
Fired when another part comes in contact with another object. This event only sends data to the client notifying it that two parts have collided, whereas Touched sends data to the server.
|
Member of:
|
BasePart
|