【发布时间】:2019-07-22 16:40:45
【问题描述】:
我尝试编写一些代码以在有人聊天“控制台打开”时在工作区中创建一个名为控制台的文件夹,并在有人说“控制台关闭”时删除它但是当我在公共游戏中运行它时(因为没有在 roblox studio 的测试模式下聊天)我得到标题错误,在阅读了几篇帖子后没有答案。
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
print("Connected")
if msg == "Console on" then
console = Instance.new("Folder",workspace)
console.name = "Console"
print("Console Made")
elseif
msg == "Console off" then
print("Console Destroyed")
console:Destroy()
end
end)
【问题讨论】:
-
您打开两个函数和一个 (else)if 但只有两个
ends。