0
0

robloxでassistant その23

Last updated at Posted at 2024-05-09

概要

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

練習問題

湯婆婆を表示せよ。

写真

image.png

サンプルコード

local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local gui = PlayerGui:WaitForChild("ScreenGui")

gui.TextButton.MouseButton1Click:Connect(function()
	local res = ""
	local Name = gui.TextBox.Text 
	res ..= "フン。"..  Name .. "というのかい。贅沢な名だねぇ。\n"
	local Len = string.len(Name)
	local Seed = os.time()
	math.randomseed(Seed)
	local rand = math.random(Len / 3) -1
	local cnt = 3 * rand + 1
	local newName = string.sub(Name, cnt, cnt + 2) 
	res ..= "今からお前の名前は".. newName .. "だ。いいかい、" .. newName .."だよ。分かったら返事をするんだ、" .. newName .. "!!"
	gui.TextBox.Text = res
end)




以上。

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