0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

robloxでassistant その147

Last updated at Posted at 2024-07-28

概要

robloxでassistantやってみた。
練習問題、やってみた。

練習問題

CollectionServiceを使え。

サンプルコード

print(game["Run Service"]:IsClient(), script:GetFullName())
local CS = game.CollectionService
CS:GetInstanceAddedSignal("test"):Connect(function(a)
	print("added", a)
end)
CS:GetInstanceRemovedSignal("test"):Connect(function(a)
	print("removed", a)
end)
print("a")
wait(1)
print("b")
Instance.new("Part", workspace):AddTag("test")
wait(1)
game.Workspace.Part:Destroy();

実行結果

  10:11:12.027  Hello world!  -  サーバー
  10:11:12.896  true ReplicatedFirst.LocalScript  -  クライアント - LocalScript:4
  10:11:12.897  a  -  クライアント - LocalScript:12
  10:11:13.375  Hello world!  -  クライアント
  10:11:14.083  b  -  クライアント - LocalScript:14
  10:11:14.084  added Part  -  クライアント - LocalScript:7
  10:11:15.087  removed Part  -  クライアント - LocalScript:10

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?