Open1

【Roblox(ロブロックス)】Playerのイベント系メモ

eisukeeisuke
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    local gold = Instance.new("IntValue") #データオブジェクト作成
	gold.Name = "Gold" #オブジェクト名
	gold.Value = 250 #値
	gold.Parent = player #データオブジェクトをどこに置くか

player.CharacterAdded:Connect(function(character)
		#Humanoidがゲームに追加されたタイミング
	end)
end)

Players.PlayerRemoving:Connect(function(player)
end)

https://create.roblox.com/docs/reference/engine/classes/Players#PlayerAdded
https://create.roblox.com/docs/ja-jp/reference/engine/classes/Player#CharacterAdded