lua roblox gui脚本格式

发布于 2025-01-17 15:06:32 字数 587 浏览 3 评论 0原文

我一直在尝试遵循有关滑动门的YouTube教程。

https:///www.youtube.com/www.youtube.com/watch? Terra

我遵循了所有教程,但门仍然没有打开。

这是脚本:

animator = require(script.Parent.MainDoor.Animator)

script.Parent.Button.ClickDetector.MouseClick:Connect(function()
    script.Parent.Button.CLickDetector.MaxActivationDistance = 0
    wait(1)
    script.Parent.MainDoor.Open:Play()
    wait(0.1)
    animator.DoorOpen:Play()

end)

有人可以帮我吗?谢谢。

I've been trying to follow this youtube tutorial about a Sliding Door.

https://www.youtube.com/watch?v=8ZpD8t8kQC8&ab_channel=Terra

I followed all of the tutorial but the Door still doesn't open.

Here is the script:

animator = require(script.Parent.MainDoor.Animator)

script.Parent.Button.ClickDetector.MouseClick:Connect(function()
    script.Parent.Button.CLickDetector.MaxActivationDistance = 0
    wait(1)
    script.Parent.MainDoor.Open:Play()
    wait(0.1)
    animator.DoorOpen:Play()

end)

Can someone please help me. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蔚蓝源自深海 2025-01-24 15:06:32

输出中有任何错误吗?去查看>输出,为了启用窗口,

我相信第4行的“ ClickDetector”可能会出现拼写错误。 L在第3行上不是资本,因此可能会给您带来错误,因为名称对病例敏感。

script.Parent.Button.CLickDetector.MaxActivationDistance = 0

希望它能有所帮助!

回应:

大门不是模型工作区的有效成员。

确保主门在滑板型号下方,而不是外部。

将其粘贴到命令栏(视图>命令栏)中,以找出父的含义:

for _,v in ipairs(workspace:GetDescendants()) do
    if string.lower(v.Name) == "maindoor" then
        print("Found main door, parent is: " .. tostring(v.Parent))
    end
end

结果将显示在输出中。

Are there any errors in the output? Go to View > Output, to enable the window

I believe there might be a spelling error on line 4 'CLickDetector'. The l was not capital on line 3 so that might be throwing you an error since names are case-sensitive.

script.Parent.Button.CLickDetector.MaxActivationDistance = 0

Hope it helped!

In response to:

main door is not a valid member of model workspace.sliding door

Make sure that the main door is underneath the SlidingDoor model, and not outside it.

Paste this in the command bar(View > Command Bar), to find out what the parent is:

for _,v in ipairs(workspace:GetDescendants()) do
    if string.lower(v.Name) == "maindoor" then
        print("Found main door, parent is: " .. tostring(v.Parent))
    end
end

The result will be shown in the output.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文