【发布时间】:2016-05-27 16:56:14
【问题描述】:
我在 GML 中编写了一个脚本,该脚本应该在执行脚本之前等待几秒钟,但我尝试了它,但它不起作用。有人可以帮忙吗?而且我不想使用等待/睡眠功能,因为这会延迟房间里的一切。这是我的脚本。
//Rename this script according to what you want to wait for
//Here is how many seconds we want to wait.
var seconds = 0;
//We will multiply the amount of seconds by the room speed, and store it in a variable
var waittime = seconds * room_speed;
//Then, we will define a script for later
var script = "Your Script here";
//Then, we will add a question, and it will ask if the room speed is the same as the wait time
if (room_speed == waittime or room_speed > waittime) {
//Then, if the amount of room speed is the same as the wait time, then execute the script
script_execute(script);
}
else {
//But if the amount of seconds is not equal, or greater than the wait time, then just add the fps to the wait time-
waittime += fps;
}
【问题讨论】: