noAsyncInSystemDo not call a yielding Roblox API from a synchronous Planck system.small-rules/no-async-in-systemDisallow yielding Roblox API calls in synchronous Planck system execution.
Planck systems run synchronously. If you call a yielding Roblox API from inside a system function, it pauses the entire world update mid-tick. Bad! We do not want this.
This catches any yielding call inside functions typed as PlanckSystem, System, SystemFunction,
SystemReturn, or SystemTableLike. Also works for functions returned by system factories and the system
property on those types.
The yieldable member list comes from the Roblox API catalog bundled with the plugin. Resolves services from
@rbxts/services, game.GetService(), and type annotations.
noAsyncInSystemDo not call a yielding Roblox API from a synchronous Planck system.This rule accepts one options object after the severity.
import { Players as RobloxPlayers } from "@rbxts/services"; const socialSystem: SystemFunction = () => RobloxPlayers.GetFriendsAsync(userId);import { Players } from "@rbxts/services"; const system: SystemFunction = () => { world.added(PlayerComponent, () => Players.GetFriendsAsync(userId)); };