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.")
endMethods
Disconnect
์ด๋ฒคํธ์ ์ฐ๊ฒฐ์ ํด์ ํ์ฌ, ๋ ์ด์ ํด๋น ์ ํธ๋ฅผ ์์ ํ์ง ์๋๋ก ๋ง๋ญ๋๋ค.
Parameters
Return
void
Code Samples
Last updated