WandLink
Defined in: server/api.d.ts:3121
Two players’ beams locked in the game’s own wand link: the beams meet at a clash point every client draws, and each player plays the wand-link clips. The script runs the contest through ratio/push and decides it with end().
Extends
Section titled “Extends”ServerEntity.ServerEntity
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WandLink(
id):WandLink
Defined in: server/api.d.ts:3126
Wraps a wand link entity id without starting one.
Parameters
Section titled “Parameters”number
Network id of the server entity to wrap.
Returns
Section titled “Returns”WandLink
Methods
Section titled “Methods”end(
winner?):boolean
Defined in: server/api.d.ts:3185
Ends the link. With a winner, the beam surges into the loser, who plays the fail clip while the winner plays the win clip; a cancel just releases both. Both players get their input back once the clips finish, and the entity is destroyed a few seconds later. Raises wandLinkEnded.
Parameters
Section titled “Parameters”winner?
Section titled “winner?”Player | null
The member who won; omit or null to cancel.
Returns
Section titled “Returns”boolean
False when the link had already ended or the winner is not in it.
push()
Section titled “push()”push(
player,amount):number|null
Defined in: server/api.d.ts:3178
Moves the clash point toward the opponent and plays a nudge at it on every client.
Parameters
Section titled “Parameters”player
Section titled “player”The member pushing.
amount
Section titled “amount”number
Ratio to move toward that player’s opponent; negative pulls back.
Returns
Section titled “Returns”number | null
The new ratio, or null when the link is not active or the player is not in it.
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: shared.d.ts:80
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: shared.d.ts:82
Restricts replication to one player’s connection, within the usual range and visibility checks; null lifts it.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: shared.d.ts:74
Returns
Section titled “Returns”string
staticof(player):WandLink|null
Defined in: server/api.d.ts:3170
The active link a player is in.
Parameters
Section titled “Parameters”player
Section titled “player”Player to look up.
Returns
Section titled “Returns”WandLink | null
start()
Section titled “start()”
staticstart(a,b,opts?):WandLink
Defined in: server/api.d.ts:3164
Links two players: both stop, turn to face each other and play the wand-link clips while beams join their wands. Throws when they cannot link: not connected, dead, mounted, already linked, in different worlds, or not 1.5 m to maxDistance apart.
Parameters
Section titled “Parameters”First member; the beam on its side uses the game’s player colors.
Second member.
Starting ratio (default 0.5) and maxDistance in world units (default 4000).
Returns
Section titled “Returns”WandLink
Properties
Section titled “Properties”active
Section titled “active”
readonlyactive:boolean
Defined in: server/api.d.ts:3136
True until end() or a member leaves or dies.
connected
Section titled “connected”
readonlyconnected:boolean
Defined in: server/api.d.ts:3141
True once the beams have met, about 3.7 s after start(): both players swing first, as in the game’s own wand link. Count a contest from here.
readonlyid:number
Defined in: shared.d.ts:65
Network id, stable for the entity’s lifetime.
playerA
Section titled “playerA”
readonlyplayerA:Player|null
Defined in: server/api.d.ts:3146
The first player passed to start(); null once the link is destroyed.
playerB
Section titled “playerB”
readonlyplayerB:Player|null
Defined in: server/api.d.ts:3151
The second player passed to start(); null once the link is destroyed.
position
Section titled “position”position:
Vector3
Defined in: shared.d.ts:67
World position. Read, call set(...), then assign back.
ratio:
number
Defined in: server/api.d.ts:3131
Where the clash point sits between the wand tips: 0 at playerA’s, 1 at playerB’s, so it rises while playerA is winning. Clamped to [0, 1]; writes are ignored once the link has ended, and end(winner) leaves it at the loser’s end.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: shared.d.ts:69
Reads as a quaternion; assignments also accept Euler angles in degrees.
readonlystate:StateBag
Defined in: shared.d.ts:71
This entity’s key/value state: the server writes it, and every client that can see the entity receives it. See StateBag.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: shared.d.ts:73
The virtual world this entity replicates in. Read-only: change it with setVirtualWorld on the server.
winner
Section titled “winner”
readonlywinner:Player|null
Defined in: server/api.d.ts:3156
The player end() named; null while active, after a cancel, or once destroyed.