User:SoulStealer9875/How to Script/Page2: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>SoulStealer9875
Created page with "== Introduction == This page is dedicated to properties, if you already know about properties and how to access them via script, you can always [[User:SoulStealer9875/How_to_..."
 
>SoulStealer9875
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 12: Line 12:


Some properties, such as Transparency, are number properties. You can tell this because their default value is a number. Here are some examples:
Some properties, such as Transparency, are number properties. You can tell this because their default value is a number. Here are some examples:
 
{| class="wikitable"
Transparency | 0 = Opaque | 0.2/0.3 = Translucent | 0.5 = Transparent | 1 = Invisible
! scope="row" | Transparency
 
| 0 = Opaque || 0.2/0.3 = Translucent || 0.5 = Transparent || 1 = Invisible
Reflectance | 0 = Not shiny | 0.5 = Semi-shiny | 1 = Very shiny
|}
 
{| class="wikitable"
! scope="row" | Reflectance
| 0 = Not shiny || 0.5 = Semi-shiny || 1 = Very shiny
|}
You get the idea. Changing them with a script is the same thing. First, locate the object. You can use a variable if you are going to change it frequently with a script, or you can do it direct.
You get the idea. Changing them with a script is the same thing. First, locate the object. You can use a variable if you are going to change it frequently with a script, or you can do it direct.


Direct:
Direct:


  Workspace.Part.Transparency = 0.5
  {{lua|=Workspace.Part.Transparency = 0.5}}


Variable
Variable


  part = Workspace.Part
  {{lua|=part = Workspace.Part
  part.Transparency = 0.5
  part.Transparency = 0.5}}


Does exactly the same thing, two different methods of doing this.
Does exactly the same thing, two different methods of doing this.
Line 38: Line 41:
You get some properties such as CanCollide that are a Boolean. They are either true or false, in this case, true being collidable and false being walkthrough and is completely the same in a script.
You get some properties such as CanCollide that are a Boolean. They are either true or false, in this case, true being collidable and false being walkthrough and is completely the same in a script.


  Workspace.Part.CanCollide = false
  {{lua|=Workspace.Part.CanCollide = false}}


== Enum Properties ==
== Enum Properties ==


Read up on your Enum Properties [[http://wiki.roblox.com/index.php/Enum|here]]
Read up on your Enum Properties [[Enum|here]]




[[User:SoulStealer9875/How_to_Script|<- Previous Page]] | [[User:SoulStealer9875/How_to_Script/Page3|Next Page ->]]
[[User:SoulStealer9875/How_to_Script|<- Previous Page]] | [[User:SoulStealer9875/How_to_Script/Page3|Next Page ->]]

Latest revision as of 14:45, 29 April 2012

Introduction

This page is dedicated to properties, if you already know about properties and how to access them via script, you can always skip this.

What are properties?

Properties are found in all objects. To view a certain object's properties in Properties pane, open up the pane (view -> properties), insert the object you want to know about it's properties and take a look at its properties in the properties pane.

Properties are used to customize the object. Some examples are BrickColor, to change its color, Transparency, to change transparency to invisible, translucent or opaque, CanCollide to see if you can collide with it or walk through it, there are lots of different properties for different objects.

Number Properties

Some properties, such as Transparency, are number properties. You can tell this because their default value is a number. Here are some examples:

Transparency 0 = Opaque 0.2/0.3 = Translucent 0.5 = Transparent 1 = Invisible
Reflectance 0 = Not shiny 0.5 = Semi-shiny 1 = Very shiny

You get the idea. Changing them with a script is the same thing. First, locate the object. You can use a variable if you are going to change it frequently with a script, or you can do it direct.

Direct:

Workspace.Part.Transparency = 0.5

Variable

part = Workspace.Part
 part.Transparency = 0.5

Does exactly the same thing, two different methods of doing this.

Color3 Properties

Some properties, such as BrickColor property of Part, WedgePart etc. is a Color3 property. We will learn of Color3 properties later, as they are a little more advanced.

Bool Properties

You get some properties such as CanCollide that are a Boolean. They are either true or false, in this case, true being collidable and false being walkthrough and is completely the same in a script.

Workspace.Part.CanCollide = false

Enum Properties

Read up on your Enum Properties here


<- Previous Page | Next Page ->