import{_ as s,o as a,c as e,Q as n}from"./chunks/framework.419948d5.js";const F=JSON.parse('{"title":"Getting Started","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md"}'),l={name:"guide/getting-started.md"},o=n(`
First, you have to require the module
local FastNet2 = require('path.to.module');
local FastNet2 = require('path.to.module');
Then, to create a new event you have to use .new
function
local Remote = FastNet2.new("EventName");
local Remote = FastNet2.new("EventName");
Firing event everytime player join
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
Remote:Fire(player, "Welcome!")
end)
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
Remote:Fire(player, "Welcome!")
end)
FastNet2 have built-in feature called pre-process
that could wait until the player event is being connected, so you dont have worry about that!