File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
content/en-us/reference/engine/datatypes Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,18 @@ type: datatype
33summary : |
44 A connection between an `Datatype.RBXScriptSignal` and a function.
55description : |
6- The `Datatype. RBXScriptConnection` data type, also known as a Connection, is a
7- special object returned by the Connect method of an Event
6+ The `RBXScriptConnection` data type is a special object returned by the
7+ `Datatype.RBXScriptSignal: Connect()|Connect()` method of an event
88 (`Datatype.RBXScriptSignal`). This is used primarily to disconnect a listener
99 from an `Datatype.RBXScriptSignal`.
10+
1011 ```lua
1112 local part : BasePart = script.Parent
12- -- Store a reference to the RBXScriptConnection so we can disconnect it later
13+ -- Store reference to the RBXScriptConnection so it can be disconnected later
1314 local connection : RBXScriptConnection = part.Touched:Connect(function(otherPart)
1415 print("Hello world!")
1516 end)
16- -- Wait 15 seconds, then disconnect the lart
17+ -- Wait 15 seconds, then disconnect
1718 task.wait(15)
1819 connection:Disconnect()
1920 ```
@@ -28,8 +29,8 @@ properties:
2829 summary : |
2930 The state of the RBXScriptConnection.
3031 description : |
31- Describes whether or not the connection is still alive. This becomes false
32- if `connection: Disconnect()` is called.
32+ Describes whether or not the connection is still alive. This becomes ` false`
33+ if `Datatype.RBXScriptConnection:Disconnect()| Disconnect()` is called.
3334 code_samples : []
3435 tags : []
3536 deprecation_message : ' '
You can’t perform that action at this time.
0 commit comments