An Event in ROBLOX lua, is when something occurs in game. This may be a part being touched, or a Player respawning. Events can be connected to a function, and this function will run when the event is called. Some events also come with arguments, that can be used.


This example is an example of a ExplorerImageIndex 1Part being touched.

local part ="Part",workspace)
local connection = part.Touched:Connect(function(hit)
print("I've been touched by "..hit.Name)

In this example, a part is being created. When it is touched, it prints the name of the touching part. 'hit' is an argument provided, which is the part touching the created part.

But what is the 'connection' variable? 'connection' is a RBXScriptConnection. An RBXScriptConnection is an object returned by the :Connect() function of an event.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.