NetConnect

Family: Multiplayer · 3 forms

What it does

NetConnect takes no arguments, and answers an integer. That is the first of 3 forms.

Syntax

1
NetConnect() → integer
2
NetConnect(projectId string) → integer
3
NetConnect(projectId string, url string, playerName string, team string) → integer

Parameters

NameTypeIn forms
projectIdstring2, 3
urlstring3
playerNamestring3
teamstring3

Every form returns

integer

Example · generated

Form 1, the short one

DO  Print(NetConnect())  Sync()LOOP

Form 3, with every argument

DO  Print(NetConnect("value", "https://example.com", "player", "value"))  Sync()LOOP

NetConnect is called and its answer is printed every frame. 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