import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.419948d5.js";const C=JSON.parse('{"title":"Example","description":"","frontmatter":{},"headers":[],"relativePath":"guide/example.md","filePath":"guide/example.md"}'),p={name:"guide/example.md"},o=l(`<h1 id="example" tabindex="-1">Example <a class="header-anchor" href="#example" aria-label="Permalink to &quot;Example&quot;">​</a></h1><p>Let&#39;s try and play something with FastNet2!</p><h2 id="server-side" tabindex="-1">Server-Side <a class="header-anchor" href="#server-side" aria-label="Permalink to &quot;Server-Side&quot;">​</a></h2><div class="language-lua vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">lua</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> FastNet2 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">require</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;path.to.module&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Events</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Example </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Example&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Ping </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Ping&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Pong </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Pong&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> PingAll </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;PingAll&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#B392F0;">Example</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Connect</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">function</span><span style="color:#E1E4E8;">(player, arg1, arg2)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(arg1, arg2)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;Whooo!&quot;</span></span>
<span class="line"><span style="color:#F97583;">end</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#B392F0;">Ping</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Connect</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">function</span><span style="color:#E1E4E8;">(player, ping)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">if</span><span style="color:#E1E4E8;"> ping </span><span style="color:#F97583;">then</span></span>
<span class="line"><span style="color:#E1E4E8;">        </span><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;PING!&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">        </span><span style="color:#B392F0;">Pong</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Fire</span><span style="color:#E1E4E8;">(player, </span><span style="color:#79B8FF;">true</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">        </span><span style="color:#B392F0;">PingAll</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Fires</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">true</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">end</span></span>
<span class="line"><span style="color:#F97583;">end</span><span style="color:#E1E4E8;">)</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> FastNet2 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">require</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;path.to.module&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Events</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Example </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Example&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Ping </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Ping&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Pong </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Pong&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> PingAll </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;PingAll&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6F42C1;">Example</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Connect</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">function</span><span style="color:#24292E;">(player, arg1, arg2)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#005CC5;">print</span><span style="color:#24292E;">(arg1, arg2)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;Whooo!&quot;</span></span>
<span class="line"><span style="color:#D73A49;">end</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6F42C1;">Ping</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Connect</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">function</span><span style="color:#24292E;">(player, ping)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">if</span><span style="color:#24292E;"> ping </span><span style="color:#D73A49;">then</span></span>
<span class="line"><span style="color:#24292E;">        </span><span style="color:#005CC5;">print</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;PING!&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">        </span><span style="color:#6F42C1;">Pong</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Fire</span><span style="color:#24292E;">(player, </span><span style="color:#005CC5;">true</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">        </span><span style="color:#6F42C1;">PingAll</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Fires</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">true</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">end</span></span>
<span class="line"><span style="color:#D73A49;">end</span><span style="color:#24292E;">)</span></span></code></pre></div><h2 id="client-side" tabindex="-1">Client-Side <a class="header-anchor" href="#client-side" aria-label="Permalink to &quot;Client-Side&quot;">​</a></h2><div class="language-lua vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">lua</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Players </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">game</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">GetService</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Players&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> FastNet2 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">require</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;path.to.module&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Events</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Example </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Example&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Ping </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Ping&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> Pong </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Pong&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> PingAll </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> FastNet2.</span><span style="color:#79B8FF;">new</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;PingAll&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Connect the events</span></span>
<span class="line"><span style="color:#B392F0;">Pong</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Connect</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">function</span><span style="color:#E1E4E8;">(pong: </span><span style="color:#79B8FF;">boolean</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">if</span><span style="color:#E1E4E8;"> pong </span><span style="color:#F97583;">then</span></span>
<span class="line"><span style="color:#E1E4E8;">        </span><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;PONG!&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">end</span></span>
<span class="line"><span style="color:#F97583;">end</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#B392F0;">PingAll</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Connect</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">function</span><span style="color:#E1E4E8;">(isPing: </span><span style="color:#79B8FF;">boolean</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">if</span><span style="color:#E1E4E8;"> isPing </span><span style="color:#F97583;">then</span></span>
<span class="line"><span style="color:#E1E4E8;">        </span><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;I PINGED!&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#F97583;">end</span></span>
<span class="line"><span style="color:#F97583;">end</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Let&#39;s check if the events is being connected!</span></span>
<span class="line"><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(Pong.</span><span style="color:#B392F0;">Connected</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(PingAll.</span><span style="color:#B392F0;">Connected</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Let&#39;s wait \`Example\` event being triggered!</span></span>
<span class="line"><span style="color:#E1E4E8;">task.</span><span style="color:#79B8FF;">spawn</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">function</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Waiting for the event...&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#B392F0;">Example</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Wait</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#E1E4E8;">    </span><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Hey the event just triggered!&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">end</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Try request a event from server!</span></span>
<span class="line"><span style="color:#79B8FF;">print</span><span style="color:#E1E4E8;">(</span><span style="color:#B392F0;">Example</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Pull</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Hello&quot;</span><span style="color:#E1E4E8;">, </span><span style="color:#9ECBFF;">&quot;this is from &gt; &quot;</span><span style="color:#F97583;">..</span><span style="color:#E1E4E8;">Players.</span><span style="color:#B392F0;">LocalPlayer</span><span style="color:#E1E4E8;">.</span><span style="color:#B392F0;">Name</span><span style="color:#E1E4E8;">))</span></span>
<span class="line"><span style="color:#6A737D;">-- Do a ping &amp; pong to server!</span></span>
<span class="line"><span style="color:#B392F0;">Ping</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Fire</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">true</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#E1E4E8;">task.</span><span style="color:#79B8FF;">wait</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">-- lets wait 1 seconds!</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Disconnect the events</span></span>
<span class="line"><span style="color:#B392F0;">Pong</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Disconnect</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">PingAll</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">Disconnect</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Yay Done!</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Players </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">game</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">GetService</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Players&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> FastNet2 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">require</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;path.to.module&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Events</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Example </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Example&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Ping </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Ping&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> Pong </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Pong&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> PingAll </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> FastNet2.</span><span style="color:#005CC5;">new</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;PingAll&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Connect the events</span></span>
<span class="line"><span style="color:#6F42C1;">Pong</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Connect</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">function</span><span style="color:#24292E;">(pong: </span><span style="color:#005CC5;">boolean</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">if</span><span style="color:#24292E;"> pong </span><span style="color:#D73A49;">then</span></span>
<span class="line"><span style="color:#24292E;">        </span><span style="color:#005CC5;">print</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;PONG!&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">end</span></span>
<span class="line"><span style="color:#D73A49;">end</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6F42C1;">PingAll</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Connect</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">function</span><span style="color:#24292E;">(isPing: </span><span style="color:#005CC5;">boolean</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">if</span><span style="color:#24292E;"> isPing </span><span style="color:#D73A49;">then</span></span>
<span class="line"><span style="color:#24292E;">        </span><span style="color:#005CC5;">print</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;I PINGED!&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#D73A49;">end</span></span>
<span class="line"><span style="color:#D73A49;">end</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Let&#39;s check if the events is being connected!</span></span>
<span class="line"><span style="color:#005CC5;">print</span><span style="color:#24292E;">(Pong.</span><span style="color:#6F42C1;">Connected</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#005CC5;">print</span><span style="color:#24292E;">(PingAll.</span><span style="color:#6F42C1;">Connected</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Let&#39;s wait \`Example\` event being triggered!</span></span>
<span class="line"><span style="color:#24292E;">task.</span><span style="color:#005CC5;">spawn</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">function</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#005CC5;">print</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Waiting for the event...&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#6F42C1;">Example</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Wait</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#24292E;">    </span><span style="color:#005CC5;">print</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Hey the event just triggered!&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">end</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Try request a event from server!</span></span>
<span class="line"><span style="color:#005CC5;">print</span><span style="color:#24292E;">(</span><span style="color:#6F42C1;">Example</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Pull</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Hello&quot;</span><span style="color:#24292E;">, </span><span style="color:#032F62;">&quot;this is from &gt; &quot;</span><span style="color:#D73A49;">..</span><span style="color:#24292E;">Players.</span><span style="color:#6F42C1;">LocalPlayer</span><span style="color:#24292E;">.</span><span style="color:#6F42C1;">Name</span><span style="color:#24292E;">))</span></span>
<span class="line"><span style="color:#6A737D;">-- Do a ping &amp; pong to server!</span></span>
<span class="line"><span style="color:#6F42C1;">Ping</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Fire</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">true</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#24292E;">task.</span><span style="color:#005CC5;">wait</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">-- lets wait 1 seconds!</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Disconnect the events</span></span>
<span class="line"><span style="color:#6F42C1;">Pong</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Disconnect</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">PingAll</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">Disconnect</span><span style="color:#24292E;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- Yay Done!</span></span></code></pre></div>`,6),e=[o];function t(c,r,E,y,i,F){return n(),a("div",null,e)}const g=s(p,[["render",t]]);export{C as __pageData,g as default};
