User:ENET/StepByStep/Game Indexing

From Legacy Roblox Wiki
Revision as of 02:59, 1 February 2012 by >ENET
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Game Indexing

Game Layout

+ game
- Workspace
- Players
- Lighting
- Teams

To the left is the basic game layout of the default roblox place. Any time you first create a new game, that is what this looks like. It is fairly simple to understand. The top of the list is game, all the items beneath it are sub-directories of game. Think of it like this, game is a folder, and all the other items are folders within game. To get to them you first have to 'open'(index) game.




Indexing a Player

Game Layout

+ game
- Workspace
- Players
-- BlueTaslem
-- Player
-- LocalChum
-- ENET
- Lighting
- Teams

Let's say that is our current game layout. Well, our goal is to index the player named 'ENET', who just so happens to be colored blue so you can see. As you may tell, he is located in the folder named 'Players' which just so happens to be located in 'game'. So how do we index the player?

game.Players.ENET

Woah, what is that? That, my friend, is how you index players. Notice we used a '.' to index a child/subfolder with in the parent/current folder. Saying 'game' indexs 'game', if we say 'game.Players' we index game, then the . says that we are gonnah index a child of the current index, so putting '.Players' after 'game' says to get the index named Players in game.
Saying 'game.Players.ENET' says get game, then get Players in game, then get ENET in Players. Note that when indexing, names are case-sensitive. 'Players' is not the same as 'PlayERS', and 'ENET' is not the same as 'enet'. That is basic indexing, of a player.

Indexing an Item within Workspace

Game Layout

+ game
- Workspace
-- AdminCommands
-- ThisBeACar
-- Model1
-- ThisIsAPart
- Players
- Lighting
- Teams

For this example, the display to the left is our current game setup. Notice, workspace has some items/files in it. Lets get started... In this example, we are wanting to index the part in workspace named 'ThisIsAPart' which is color-coded blue. To do this we first need to index the workspace.

game.Workspace

The above example indexs the workspace, so now that we have that, we are now in the Workspace folder. However, we don't want to index workspace, we want to index the part. So lets extend our little indexing...

game.Workspace.ThisIsAPart

The above writing indexes ThisIsAPart inside of Workspace inside of game. Congratulations, that is the basics of indexing!