With events, you can respond to actions in Roblox, for example when someone presses a button or a game starts. This makes your game lively and exciting!
Here's how:
With events, you can make your game interactive and exciting – try it out now!
-- Dieses Script kommt in einen Part im Workspace
local part = script.Parent
-- Funktion, die ausgeführt wird, wenn der Part berührt wird
local function onTouched(otherPart)
print(otherPart.Name .. " hat den Part berührt!") -- Nachricht in der Konsole
end
-- Event mit Funktion verbinden
part.Touched:Connect(onTouched)