リモコンで呼ぶと来る!絵文字意思疎通装置を作る

キャラクターモデルのスクリプト

local button1 = script.Parent.Button1
local button2 = script.Parent.Button2
local button3 = script.Parent.Button3
local button4 = script.Parent.Button4

local f1 = "🥰"
local f2 = "😁"
local f3 = "😆"
local f4 = "🥳"

button1.SurfaceGui.TextLabel.Text = f1
button2.SurfaceGui.TextLabel.Text = f2
button3.SurfaceGui.TextLabel.Text = f3
button4.SurfaceGui.TextLabel.Text = f4

local charahumanoid = script.Parent:WaitForChild("Humanoid")

local chats = game:GetService("Chat")

local function clicked1(player)
	
	local character = player.Character
	if not character then return end
	
	local head = character:FindFirstChild("Head")
if not head then return end	
	
	chats:Chat(head, f1)
	
end

local function clicked2(player)


	local character = player.Character
	if not character then return end

	local head = character:FindFirstChild("Head")
	if not head then return end	

	chats:Chat(head, f2)

end

local function clicked3(player)


	local character = player.Character
	if not character then return end

	local head = character:FindFirstChild("Head")
	if not head then return end	

	chats:Chat(head, f3)

end

local function clicked4(player)


	local character = player.Character
	if not character then return end

	local head = character:FindFirstChild("Head")
	if not head then return end	

	chats:Chat(head, f4)

end

button1.ClickDetector.MouseClick:Connect(clicked1)
button2.ClickDetector.MouseClick:Connect(clicked2)
button3.ClickDetector.MouseClick:Connect(clicked3)
button4.ClickDetector.MouseClick:Connect(clicked4)

local function sit()
	
	task.wait(2)
	charahumanoid.Jump = true
end



charahumanoid:GetPropertyChangedSignal("SeatPart"):Connect(sit)

ツールのスクリプト

local rimo = script.Parent
local sotsu = workspace["11ishisotsu"]:WaitForChild("Ishisotsu").Humanoid

local function help()
	
	
	local rimox = rimo.Handle.Position.X
	--local rimox = rimo.Handle.Position.Y
	local rimoz = rimo.Handle.Position.Z
	
	rimo.Handle["Light click off and on sound"]:Play()
	
	sotsu:MoveTo(Vector3.new(rimox,0,rimoz))
	
end

rimo.Activated:Connect(help)