注意:这篇文章上次更新于1744天前,文章内容可能已经过时。
This article was last updated1744 days ago, the content may be outdated.

游戏目标
制作定时桥,当人物未在规定时间内过桥将会失败。
大体需要以下几个步骤:
- 制作地形,建造一座桥 Bridge
- 制作按键 ButtonBridge
- 制作计时器 TimerDisplay
PS:这是少儿编程
Game Goal
Make a timed bridge: if the character fails to cross the bridge within the set time, the game fails.
Roughly the following steps are needed:
- Create the terrain and build a bridge — Bridge
- Make the button — BridgeButton
- Make the timer — TimerDisplay
PS: this is kids’ programming
Roblox Studio
Roblox 中国官网
解决 Roblox Studio 中国版一直正在登录的问题
安装好 Roblox Studio 后第一次使用可以打开软件界面,从第二次打开软件开始,就一直卡在正在登录的界面。我也不知道具体什么原因,大胆猜测是因为 Roblox 在国内和鹅厂有一些 PY 交易,所以问题出在鹅厂身上😏。
看这快捷方式的后缀,本来陌生而又高大上的东西瞬间就亲切了许多
因为考虑到是鹅厂的问题,我就翻墙去了国际版官网 https://roblox.com 下载了国际版的 Roblox Studio ,并且在全局代理的模式下尝试登录国际版的账号。好家伙,点击登录一点反应也没有!
最后,女朋友帮 我 她自己找到了解决方案。
进入下面的文件夹:
C:\Users\ {你的用户名} \AppData\Local\Roblox\Versions-qq\version-{乱七八糟}
打开 RobloxStudioLauncherBeta.exe
如果成功,将RobloxStudioLauncherBeta.exe发送到桌面快捷方式。
如果过几天发现快捷方式也不好用,可以通过写 bat 文件的形式创建快捷方式。
新建一个 Roblox Studio.txt 文件,在文件中写入如下内容。
1 | start C:\Users\{你的用户名}\AppData\Local\Roblox\Versions-qq\version-{乱七八糟的字符串}\RobloxStudioLauncherBeta.exe |
最后,重命名文件为 Roblox Studio.bat ,双击这个文件,就可以打开 Roblox Studio 了。
Roblox Studio
Roblox China Official Website
Fixing the China Version of Roblox Studio Being Stuck on “Logging In”
After installing Roblox Studio, the first use works and opens the software interface, but from the second launch on, it’s stuck on the “logging in” screen. I don’t know the exact reason; my bold guess is that Roblox has some shady deals with Tencent in China, so the problem lies with Tencent 😏.
Look at the suffix of this shortcut — something that was unfamiliar and high-end instantly feels much friendlier
Since I figured it was Tencent’s problem, I used a VPN to visit the international official site https://roblox.com, downloaded the international version of Roblox Studio, and tried logging in with an international account in global proxy mode. Wow — clicking Login had no response at all!
In the end, my girlfriend helped me — well, she herself found the solution.
Go into the following folder:
C:\Users\ {你的用户名} \AppData\Local\Roblox\Versions-qq\version-{乱七八糟}
Open RobloxStudioLauncherBeta.exe
If it works, send RobloxStudioLauncherBeta.exe to the desktop as a shortcut.
If the shortcut stops working after a few days, you can create a shortcut by writing a bat file.
Create a new Roblox Studio.txt file and write the following into it:
1 | start C:\Users\{你的用户名}\AppData\Local\Roblox\Versions-qq\version-{乱七八糟的字符串}\RobloxStudioLauncherBeta.exe |
Finally, rename the file to Roblox Studio.bat; double-click this file and you can open Roblox Studio.
界面搭建
打开软件,点击新增,使用 Baseplate 创建你的游戏。

在地形编辑器中点击 生成,勾选 平原 ,丘陵 和 山脉,点击生成按钮。

创建好的地形看不见人物的出现的地点,我们通过依次点击 模型=> 重生点,可以看见场景中显示了玩家出现的位置。

通过地形编辑器,侵蚀,把地面挖个坑出来。

再通过地形编辑器的填充操作,把坑里放上水。

接下来要插入三个 Part 组件,分别用来充当桥,倒计时显示器,和倒计时按钮。
右键 => 插入部件。

可以看到场景中多了个小方块并且项目管理器中多了个 Part。

使用缩放工具可以调整部件的大小。

我们再插入两个部件作为桥和倒计时显示器。把地形做成如下形式,并且做好重命名工作。

接下来对各个部件的属性进行设置。
首先,对三个组件都进行 Anchor(锚固),可以通过点击菜单栏中编辑选项卡中的 锚固,也可以再属性列表中勾选 Anchored。

桥的属性:
Transparency(透明度)设置为 0.8
取消选中 CanCollide
修改颜色
修改材质
在过桥时,玩家需要看到在桥消失之前还剩几秒。显示图像或文本的一种方法是将一个称作 SurfaceGUI 的对象添加到部件中。
首先将 TimerDisplay 部件加入 SurfaceGUI。

在刚添加的 GUI 中,添加 TextLabel。

现在,你可能甚至无法看到 TextLabel,它非常小,并且可能位于计时器显示的错误一侧。为了让玩家可以更好地查看计时器,应该将更改与 SurfaceGUI 相连的一侧并使 SurfaceGUI 变得更大。
我这里需要把 SurfaceGUI 的 Face 属性改成 Back,修改后可以看到组件的左上角有一块变了颜色。放大查看那里就是 TextLabel 显示的文字。


接下来我们需要调整 TextLabel 的大小和位置等属性。
我这里设置 TextLabel 的 Size 属性与 SurfaceGUI 的大小相同,并勾选 TextScaled 属性。


Building the Interface
Open the software, click New, and use Baseplate to create your game.

In the terrain editor, click Generate, check Plains, Hills, and Mountains, then click the Generate button.

On the created terrain you can’t see where the character spawns; click through Model => SpawnLocation and you can see where players will appear in the scene.

Use the terrain editor’s Erode tool to dig a hole in the ground.

Then use the terrain editor’s fill operation to put water into the hole.

Next, insert three Part components to serve as the bridge, the countdown display, and the countdown button.
Right-click => Insert Part.

You can see a small block appears in the scene and a Part appears in the Explorer.

Use the Scale tool to adjust the size of the part.

Insert two more parts to serve as the bridge and the countdown display. Shape the terrain as shown below, and do the renaming properly.

Next, configure the properties of each part.
First, Anchor all three components. You can click Anchor in the Edit tab of the menu bar, or check Anchored in the properties list.

Bridge properties:
Set Transparency to 0.8
Uncheck CanCollide
Change the color
Change the material
While crossing the bridge, players need to see how many seconds are left before the bridge disappears. One way to display images or text is to add an object called SurfaceGUI to the part.
First, add a SurfaceGUI to the TimerDisplay part.

In the GUI just added, add a TextLabel.

Now you may not even be able to see the TextLabel — it’s very small and may be on the wrong side of the timer display. To let players see the timer better, you should change the side the SurfaceGUI is attached to and make the SurfaceGUI bigger.
Here I need to change the SurfaceGUI’s Face property to Back. After the change, you can see a block in the top-left corner of the component has changed color. Zoom in — that’s where the TextLabel text is displayed.


Next, we need to adjust the TextLabel’s size, position, and other properties.
Here I set the TextLabel’s Size property to the same size as the SurfaceGUI and checked the TextScaled property.


脚本编写
我们在 Bridge 组件下创建 timedBridge 脚本文件,写入如下内容。
1 | local bridge = game.Workspace.Bridge |
少儿编程的逻辑,就不解释了

Writing the Script
Create a timedBridge script under the Bridge component and write the following:
1 | local bridge = game.Workspace.Bridge |
The logic is for kids’ programming, so I won’t explain it.



