Skip to content

@this

OOP

The current object inside Class::Method. Emits Luau self. @field is that object’s member. this (no @) is the same alias.

void Service::Tick() {
@janitor.Cleanup();
@this;
this.janitor.Add(conn);
coins = coins + 1; // bare field → self.coins
}

None.

The receiver table.

self · self.field

Only valid inside Class::Method. A free function or void init() that uses @this / @field is an error.

@this is a value: pass it to other functions (other.Register(@this)other:Register(self)). There is no this-> and no @this parameter on the signature — :: already injects the receiver.

[] still indexes. [[server]] is still an attribute. @ here is only the receiver sigil.

void CombatServer::BindPart(BasePart part) {
@janitor.Add(part, "Destroy");
other.Register(@this);
}

Emits:

function CombatServer:BindPart(part: BasePart)
self.janitor:Add(part, "Destroy")
other:Register(self)
end

struct · class-method