Skip to content

Dismounter

Dismounts the player from mountable objects such as Vines, Seats and Ziplines.

Dismounter = {
-- Attributes
Dismounts: std.Attribute<std.AttributeGroup<boolean>>,
Activatable: std.Attribute<boolean>,
ActivationBehavior: std.Attribute<ActivationBehavior>,
-- API
onDismount: std.LemonSignal<std.Set<string>>,
}
Dismounter.Dismounts: std.Attribute<std.AttributeGroup<boolean>>

When activated, dismounts the “X” object.

Dismounter.Activatable: std.Attribute<boolean>

Whether this object can be activated. See the Activation page.

Dismounter.ActivationBehavior: std.Attribute<ActivationBehavior>

How should this object be activated. See the Activation page.

Dismounter.onDismount: std.LemonSignal<std.Set<string>>

The Dismounter exports a onDismount signal that is fired with a set of objects to dismount. Users are expected to implement onDismount themself.

-- within an `onActivated` callback:
local dismountTrove = trove:extend()
local function dismount()
dismountTrove:clean()
logger:info("Dismounted!")
end
dismountTrove:add(dismount)
dismountTrove:connect(Dismounter.onDismount :: any, function(objects)
if objects.MyKitObject then
dismount()
end
end)