A Roblox Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeLatest imagesRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
naknak
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
Supernapalm
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
m27frogy
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
slayer9365
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
myrco919
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
branefreez
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
ninga95
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
CloneTrooper787
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
raboy117
Connection Lines Vote_lcapConnection Lines Voting_barConnection Lines Vote_rcap 
Top posting users this month
No user
Latest topics
» Where to go from here.
Connection Lines EmptySeptember 14th 2020, 1:20 pm by MrNicNac

» Send me an Email
Connection Lines EmptySeptember 14th 2020, 1:16 pm by MrNicNac

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
Connection Lines EmptyJuly 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
Connection Lines EmptyJuly 6th 2015, 4:16 pm by m27frogy

» Ambassador!
Connection Lines EmptyApril 15th 2015, 11:40 pm by naknak

» Boop - Tag
Connection Lines EmptyApril 13th 2015, 9:46 pm by naknak

» Vip Class Script
Connection Lines EmptyApril 13th 2015, 4:54 pm by naknak

» Who's active?!
Connection Lines EmptyApril 13th 2015, 4:52 pm by naknak

» Genesis Point
Connection Lines EmptyJuly 17th 2014, 7:04 pm by branefreez

» Reward System
Connection Lines EmptyJuly 17th 2014, 5:41 am by m27frogy

» Script Request
Connection Lines EmptyJuly 10th 2014, 11:43 am by naknak

» local scripts?
Connection Lines EmptyJuly 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
Connection Lines EmptyJuly 10th 2014, 11:36 am by naknak

» Hi. I am new here
Connection Lines EmptyApril 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
Connection Lines EmptyJanuary 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
Connection Lines EmptyJanuary 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
Connection Lines EmptyJanuary 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
Connection Lines EmptyNovember 26th 2013, 3:33 pm by Keanu73

» Improve Coding
Connection Lines EmptyOctober 26th 2013, 1:12 pm by pook03

» Simple Button
Connection Lines EmptySeptember 1st 2013, 6:19 pm by branefreez


 

 Connection Lines

Go down 
3 posters
AuthorMessage
Guest
Guest
avatar



Connection Lines Empty
PostSubject: Connection Lines   Connection Lines EmptyAugust 2nd 2010, 3:43 pm

Connection lines are useful for activating a function when an event happens. They can be used to activate a function when a part is touched, clicked, etc.

Here's the syntax for a connection line:

[Object].[Action]:connect([FunctionName])

Just for an example, a connection line for a simple onTouch script would look like this
Code:
script.Parent.Touched:connect(onTouch)
To find out what actions can be used with an object, go to the ROBLOX Wiki and search for the object you are looking for. It should come up with a table. Scroll to the bottom and look for the lighting bolts. Those are the actions of the brick. Example, "Part" has these actions:
AncestryChanged
Changed
ChildAdded
ChildRemoved
DescendantAdded
DescendantRemoving
LocalSimulationTouched
Touched
Back to top Go down
Bobbyfishstick5
Expert Scripter
Expert Scripter
Bobbyfishstick5


Posts : 13
Join date : 2010-07-30
Age : 28

Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyAugust 2nd 2010, 3:48 pm

Nice Tutorial :D
Back to top Go down
Guest
Guest
avatar



Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 16th 2011, 10:46 pm

Sometimes i see people do this:

Code:

[Object].[Action]:connect(function    [FunctionName(FunctionParameters]    end))

Why is this situation sometimes valid?
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 16th 2011, 10:50 pm

Instead of
Code:
function hi()
print("Hi")
end

[Object].[Action]:connect(hi)
we can do
Code:
[Object].[Action]:connect(function()
print("Hi")
end
end)

Its shorter and I like it more
Back to top Go down
Guest
Guest
avatar



Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 16th 2011, 11:28 pm

Oh I see you just create a function out of thin air...
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 17th 2011, 12:00 am

It can be useful. I can make a kill script that is only 3 lines with that.
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 17th 2011, 8:17 am

I can make a lava script that is 2 lines:
Code:

script.Parent.Touched:connect(function(hit) hit:BreakJoints() wait(1) hit:Remove() end)
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 17th 2011, 12:55 pm

Short Player killer
Code:

script.Parent.Touched:connect(function(h)
pcall(hit.Humanoid.Health = 0 end) end)

Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines EmptyJanuary 18th 2011, 7:56 am

you forgot the function() at the start of the pcall. :o
Back to top Go down
Sponsored content





Connection Lines Empty
PostSubject: Re: Connection Lines   Connection Lines Empty

Back to top Go down
 
Connection Lines
Back to top 
Page 1 of 1
 Similar topics
-
» Connection lines not working?
» HOW TO: Multipul lines in a GUI object
» Some type of connection im guessing.

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Tutorials and Resources :: Beginner-
Jump to: