ScriptConnection

Overview

ScriptConnection์€ ์ด๋ฒคํŠธ์— ๋ฃจ์•„ ์Šคํฌ๋ฆฝํŠธ๋กœ ์ž‘์„ฑํ•œ ํ•จ์ˆ˜๋ฅผ ์ด์–ด์ฃผ๋Š” ์—ฐ๊ฒฐ ๊ฐ์ฒด์ž…๋‹ˆ๋‹ค.

์ด ๊ฐ์ฒด๋Š” Connect ํ˜ธ์ถœ ์‹œ ์ƒ์„ฑ๋˜๋ฉฐ, ํ•„์š”ํ•  ๋•Œ Disconnect ๊ธฐ๋Šฅ์„ ํ†ตํ•ด ์ด๋ฒคํŠธ ์ˆ˜์‹ ์„ ์ค‘๋‹จํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ์–ด ์ด๋ฒคํŠธ ๊ด€๋ฆฌ์— ์ค‘์š”ํ•œ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.

Constructors

Properties

Connected

boolean

์ด๋ฒคํŠธ์˜ ์—ฐ๊ฒฐ ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์†์„ฑ์ž…๋‹ˆ๋‹ค.

Disconnect ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋˜๋ฉด false๊ฐ’์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.

Code Samples

local Players = game:GetService("Players")
local Connection = nil

local function EnterPlayer(player)
    print("EnterPlayer : ", player.Name)
end
Connection = Players.PlayerAdded:Connect(EnterPlayer)

if Connection.Connected then
    print("The connection is active.")
else
    print("The connection has been disconnected.")
end

Methods

Disconnect

์ด๋ฒคํŠธ์˜ ์—ฐ๊ฒฐ์„ ํ•ด์ œํ•˜์—ฌ, ๋” ์ด์ƒ ํ•ด๋‹น ์‹ ํ˜ธ๋ฅผ ์ˆ˜์‹ ํ•˜์ง€ ์•Š๋„๋ก ๋งŒ๋“ญ๋‹ˆ๋‹ค.

Parameters

Return

void

Code Samples

Last updated