of     1   

SlyWing
#140905204Sunday, July 20, 2014 2:01 AM GMT

So, to start off, I just started on my quest to scripting success. Let's get to the point, today I was on the roblox wiki looking at the "Absolute beginner's guide to scripting" (http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting#Your_first_program) and I noticed that in to article they always refer to a part as a brick. Yes, I do realize that roblox was updated to rename bricks to parts. It's just hard at first to realize that brick = part. Once I got to the complete script ==================================================================== local brick = Workspace.Brick -- Store a reference to the brick. function onTouch(part) -- The function that runs when the part is touched. brick.Transparency = 1 wait(1) brick.Transparency = 0 end brick.Touched:connect(onTouch) -- The line that connects the function to the event. ===================================================================== I became even more confused because the function now contained the word part. I later understood that if I just renamed my part to a brick, the script would work fine. I'm just trying to let everyone be aware of this bug. (I don't know if I posted this in the right section, but I feel it is a good place to start) Thanks for your time! And remember I'm a new guy. So be nice =)
Lacryma
#140905239Sunday, July 20, 2014 2:01 AM GMT

tl;dr
SlyWing
#140905872Sunday, July 20, 2014 2:08 AM GMT

@Duelingwarlord It's my first post, I was just trying to make sure what I was trying to say was easily understood. I did go a little overboard though. =P
swimguy777
#140906021Sunday, July 20, 2014 2:10 AM GMT

I think you're just a bit confused (which is perfectly fine, it's a weird concept at first) Let's take a look at the script: local brick = Workspace.Brick -- Store a reference to the brick. function onTouch(part) -- The function that runs when the part is touched. brick.Transparency = 1 wait(1) brick.Transparency = 0 end brick.Touched:connect(onTouch) So what we have here is a variable called 'brick' that's referencing a part in workspace named Brick. Now the confusing part is the 'part' that's in the function line. 'part' is actually an *argument* that's given through the .Touched function, and it's referencing the part that is touching 'brick'. So 'brick' and 'part' are actually two very separate things. Does this make sense or do you want me to explain further? -[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
KEVEKEV77
#140906191Sunday, July 20, 2014 2:12 AM GMT

local brick = Workspace.Brick; -- Store a reference to the brick. local brick2 = Workspace.Brick2;--Add this to see difference function onTouch(part) --This is called a parameter. For touched, its just whatever is touched. SO, you could do this part.Transparency = 1 wait(1) part.Transparency = 0 end --It would change the part that was touched. --The wiki only changes brick. brick.Touched:connect(onTouch) -- The line that connects the function to the event. --Siince it only connects to brick, you cant really see change, but if you did this brick2.Touched:connect(onTouch);--Connect touching.
SlyWing
#140906985Sunday, July 20, 2014 2:19 AM GMT

Thanks for the help! Much Appreciated! =)

    of     1