// store timer on element for cleanup (el as any).__hatPusherTimer = timer;
To understand how a hat pusher script works, you have to look at Roblox's physics engine and network boundaries. The script relies on three main technical concepts: 1. Network Ownership Manipulation
create(options: HatOptions): string { const opts: HatOptions = Object.assign({}, DEFAULTS, options); const id = opts.id || genId(); if (this.hats.has(id)) throw new Error(`Hat with id $id already exists`); const container = opts.container || this.defaultContainer;
// auto dismiss let timer: number | undefined; if (opts.autoDismissMs && opts.autoDismissMs > 0) timer = window.setTimeout(() => this.remove(id), opts.autoDismissMs);