Roblox Lua开发
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Roblox Lua开发相关的知识,希望对你有一定的参考价值。
我正在尝试制作roblox游戏,但是当我用lua编写脚本时,当我触摸门时什么也没发生:文本标签的入门gui]
game.Workspace.text:GetPropertyChangedSignal("Value"):Connect:(function())
local text = script.Parent
if game.Workspace.text.Value == 1 then
script.Parent.Parent.Visible = true
text.Text = "W"
wait (.05)
text.Text = "We"
wait (.05)
text.Text = "Wel"
wait (.05)
text.Text = "Welc"
wait (.05)
text.Text = "Welco"
wait (.05)
text.Text = "Welcom"
wait (.05)
text.Text = "Welcome"
wait (.05)
text.Text = "Welcome !"
wait (.05)
wait (3)
text.Text = "C"
wait (.05)
text.Text = "Co"
wait (.05)
text.Text = "Come"
wait (.05)
text.Text = "Come I"
wait (.05)
text.Text = "Come In "
wait (.05)
text.Text = "Come In !"
wait (.05)
wait (3)
script.Parent.Parent.Visible = false
end
end)
门的代码:
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game.Workspace.text.Value = 1
end
end)
感谢您的回答,我从未用lua编码过
答案
如果怀疑脚本之一可能有问题,请检查“输出”窗格。在这种情况下,它说:
19:02:05.822 - Players.x.PlayerGui.ScreenGui.Frame.TextLabel.LocalScript:1: Expected '(', '{' or <string>, got ':'
这意味着在不应该存在一个冒号的地方。该行需要是:
game.Workspace.text:GetPropertyChangedSignal("Value"):Connect(function()
以上是关于Roblox Lua开发的主要内容,如果未能解决你的问题,请参考以下文章