Beginners Advanced Guide to Roblox

Become a Brick-smith in no time!

How to make a one way door September 30, 2009

Filed under: Begginners Guide to advanced scripting — pokemonfan143 @ 2:06 pm
Tags: , , , , , ,

First Insert a brick of the size you want. Insert a script into the brick. Now type this into the script:

door = script.Parent


function onTouch(hit)

if hit.Parent == nil then return end

local h = hit.Parent:FindFirstChild(“Humanoid”)

if h ~= nil then

hit.Parent.Torso.Velocity=door.CFrame.lookVector * 100 — Push the Player back

end

end

door.Touched:connect(onTouch)

door = script.Parent
function onTouch(hit)
if hit.Parent == nil then return end
local h = hit.Parent:FindFirstChild(“Humanoid”)
if h ~= nil then
hit.Parent.Torso.Velocity=door.CFrame.lookVector * 100 — Push the Player back
end
end
door.Touched:connect(onTouchdoor = script.Parent
function onTouch(hit)
if hit.Parent == nil then return end
local h = hit.Parent:FindFirstChild(“Humanoid”)
if h ~= nil then
hit.Parent.Torso.Velocity=door.CFrame.lookVector * 100 — Push the Player back
end
end
door.Touched:connect(onTouch)
 

How to get WorkSpace and Properties back (request) September 30, 2009

Filed under: Advanced survival (Includes Filming help),Requests — pokemonfan143 @ 1:52 pm
Tags: , , , , , , ,

Press Tool then press view and select properties or WorkspaceLike in the picture, press ‘Tools’, then press View. You can find Workspace and Properties there.

NOW STOP ASKING! Naah! Kidding… you can ask all you want. But really, don’t ask this anymore.

 

How to add tools to starterpack September 29, 2009

Hey again!

First open roblox and go to build(or edit for pros). Now press tools.

Press tools, then press view

Now press view, like in the picture. (obvious, isn’t it?)

After you press view you will see workspace, press it. (More obvious?)

Now insert a tool and you will see it in workspace.

The tool!

Drag the tool to the folder in the workspace called ‘StarterPack’

Drag!

Now Save and exit! When you press the ‘Play’ Button you will see that you have the tool! Now go play with sharp stuff! (Not in the real world!)

 

How to change mesh textures September 29, 2009

 

Gui Tutorial 1 (Available on Roblox Developer’s Journal) September 29, 2009

Filed under: Begginners Guide to advanced scripting — pokemonfan143 @ 1:09 pm
Tags: , , , ,

In this lesson, I’ll be explaining the first steps to set up a 2D GUI, and some basics about our coordinate system.

frame(Here’s a simple GUI dialog that consists of mostly frames and labels)

The first step to creating your GUI is to create a GuiMain and insert it into the player’s PlayerGui object.

———————————————————————–
local tool = script.Parent;
local character = script.Parent.Parent
local player = game.Players:GetPlayerFromCharacter(character)
local guiMain = Instance.new(“GuiMain”)
guiMain.Parent = player.PlayerGui

———————————————————————–

A GuiMain object is an invisible overlay that fills the entire screen.  If you add Frames or Labels and Buttons to it, they will be drawn.  But they have to be put into a GuiMain object.

So now that we’ve created out GuiMain object, we can start adding Frames to it.  A Frame is a container object, with a BackgroundColor and BorderColor, that can hold other objects (other Frames, in addition to Buttons and Labels).  It also will fire events when the mouse either enters and leaves, allowing you to script all kinds of cool stuff.  Lastly, it contains a Visible property which can be set to false if you want it (and all of its children) to stop rendering.  This is useful if you want to hide a Frame temporarily.

———————————————————————–
–This sample code will create and position a new Frame
local mainFrame = Instance.new(“Frame”)
mainFrame.Position = UDim2.new(0.08, 0, 0.88, -300)
mainFrame.Size = UDim2.new(0.0, 240, 0.0, 300)
mainFrame.Parent = guiMain;
———————————————————————–

Hold up.  What are all these UDim2 objects?  Well, they are new.  UDim stands for Universal Dimension, and is a compact way to specify both relative and absolute positioning at the same time.  When laying out a GUI, it is often necessary to have some positions/sizes change when a parent container’s size changes.  Other times, you might want to have a fixed offset that is a specific number of pixels.  A UDim lets you do both at the same time.

A UDim object consists of a Scale and an OffsetScale is specified as a number between 0.0 and 1.0 that represents the percentage of your parent’s size.  Offset is specified as an integer number, either positive or negative.  The final result is the combination of the two: Scale * Parent’s Size + Offset.  With the combination of these two values, almost anything is possible.  A UDim2 is just two UDim objects, referenced by X and Y. Here is the exact definition of the UDim2.new function: UDim2.new(xScale, xOffset, yScale, yOffset)

Now I’ll run through a few examples of using UDim2’s to make Gui objects stick to various parts of the screen.  Remember, Position is defined as the top left corner of the Frame.

———————————————————————–
–A 50×50 frame 5 pixels from the top, 10 pixels from the left mainFrame.Position = UDim2.new(0.00, 10, 0.0, 5)
mainFrame.Size = UDim2.new(0.0, 50, 0.0, 50)

–A frame that is half the size of the main screen, in the center
mainFrame.Position = UDim2.new(0.25, 0, 0.25, 0)
mainFrame.Size = UDim2.new(0.5, 0, 0.5, 0)

–A 50×50 frame in the top right corner
mainFrame.Position = UDim2.new(1.0, -50, 0.0, 0)
mainFrame.Size = UDim2.new(0, 50, 0, 50)

–A frame that is 1/4 the size of the screen,
–in the bottom right corner
–(For position I took the corner’s position (1.0) – the
– size (0.25) to get the position (0.75))
mainFrame.Position = UDim2.new(0.75, 0, 0.75, 0)
mainFrame.Size = UDim2.new(0.25, 0, 0.25, 0)

———————————————————————–

So that’s what a UDim2 object is all about, and how our relative positioning works.  Take a look at my sample PaintBrush tool, hopefully it makes a bit more sense now.

One last tip:  If you’d like to try playing around with Positions and Sizes, open up a level in edit mode and drop a GuiMain (and some Frames)  into the StarterGui. Start playing with the numbers to get a feel for how it changes, and try resizing Roblox to see how using Scales changes your GUI.  Note that StarterGui has a ShowDevelopmentGui flag that you can use to hide it while you are working on your level.  Make sure its checked or nothing will show up.

Tutorial by: Madrak

 

How to copy pants and shirts! (BC/TBC) (request) September 29, 2009

Note: For builders club and turbo builders club only!

Hey there! I am back with a new tutorial. Yep. Lets get on with it!

Have you always wanted a cool shirt and pants for FREE! If you follow these steps you can have any shirt or pant for FREE! Now don’t go thinking I am joking with ya… cause I’M NOT! O.K. then.

First find a shirt/pant you always wanted. Press it and it will open up the page. Now this is the copying part. Pay real close attention to this!

Address Bar

Go to the address bar up there ^.

I am going to take that as an example. Can you see the numbers at the end of the address? In the example picture it is “5120606″. Now subtract the number by 1. In the example picture, if you subtract it, it will be “5120605″. After you have subtracted it  the picture should be the template.

Now this is the BC/TBC part. Those of you that don’t have BC/TBC go do something that you CAN do. O.K.?

Copy the template picture and save it on your desktop. Now get an original Template and Cut the parts of the copied template to the original template. I don’t recommend you resizing the copied template because it doesn’t work. Remember the original template must be the same size!

O.K. bubs?

After you have cut and pasted the parts, you can now create a shirt/pants. Press the create button and upload your newly copied shirt/pants.

Here is a how an original shirt template look like:

ShirtTemplate

WARNING: THIS TUTORIAL ONLY WORKS ON SHIRTS/PANTS/DECALS ONLY! But of course, you already know that, don’t you? Well, I doubt you know this unless you have read the TITLE!

 

 
Follow

Get every new post delivered to your Inbox.