NetworkLocalInteger

Family: Multiplayer · 2 forms

What it does

NetworkLocalInteger writes to a Multiplayer object: it sets rather than reads. It takes iNetID (an integer), name (a string) and i (an integer), and returns nothing. That is the first of 2 forms. iNetID is the id of a Net object, obtained elsewhere in the Multiplayer family.

Syntax

1
NetworkLocalInteger(iNetID integer, name string, i integer)
2
NetworkLocalInteger(iNetID integer, name string, i integer, mode integer)

Parameters

NameTypeIn forms
iNetIDintegerall
namestringall
iintegerall
modeinteger2

Every form returns

nothing

Example · generated

Form 1, the short one

net = CreateNetworkMessage()NetworkLocalInteger(net, "player", 1)DO  Sync()LOOP

Form 2, with every argument

net = CreateNetworkMessage()NetworkLocalInteger(net, "player", 1, 1)DO  Sync()LOOP

CreateNetworkMessage is there to give the call something to act on; NetworkLocalInteger is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

91 commands in Multiplayer