Reference API Roblox

Engine API

Website

Related

Reference API Roblox

AdPortal

A portal that teleports players to a sponsored experience as part of immersive ads.

Member index 3

HistoryMember
543PortalInvalidReason: string
569Status: AdUnitStatus
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
723IsInSandbox: bool
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 4

HistoryMember
577PortalStatus: AdPortalStatus
688TeleportConfirmed(placeId: int64, player: Player): null
688TeleportRejected(shouldCooldown: bool, rejectedByDistance: bool): null

Description

An AdPortal is an instance that must be parented to a Part — attempting to parent it elsewhere throws an error. When added to the data model, it registers itself with AdService to be served portal ads on rotation, and it uses a child AdGui to display the current ad's banner image and destination label above the portal.

When the local player's character touches the parent part, the portal teleports that player to the sponsored experience associated with the currently served ad. The portal only teleports while it is valid and has been served an ad with a destination place (see AdPortal.Status).

History 24

Members 3

PortalInvalidReason

TypeDefault
string

Holds a human-readable explanation of why the AdPortal is not in a valid, servable state. When the portal passes validation the value is an empty string; when validation fails it is populated with the specific reason reported by the portal's validator, such as an unsuitable parent or a misconfigured child AdGui.

This property is read-only and defaults to an empty string (""). It is intended for surfacing configuration problems to creators in Studio.

This property is not scriptable. It cannot be accessed by script code.
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated, NotScriptable]

Status

TypeDefault
AdUnitStatusInactive

Reports the portal's current AdUnitStatus. The value is AdUnitStatus.Active only when the portal has passed validation and has been served an ad with a valid destination place; in every other case it is AdUnitStatus.Inactive.

A newly created portal reports AdUnitStatus.Inactive, because its destination place is unset (0) until the ad service fills the portal with an ad — the portal cannot become AdUnitStatus.Active, and therefore cannot teleport, until that happens. This property is read-only.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

Removed members 4

PortalStatus

TypeDefault
AdPortalStatusInvalid
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated, Deprecated]

TeleportConfirmed

Parameters (2)
placeIdint64
playerPlayer
Returns (1)
null

History 2

TeleportRejected

Parameters (2)
shouldCooldownbool
rejectedByDistancebool
Returns (1)
null

History 2

Settings