【发布时间】:2020-12-17 13:35:59
【问题描述】:
所以有 2 个脚本:script 和 localscript。
脚本确定将有多少秒,然后将其触发到所有玩家客户端,并且本地脚本将文本更改为秒。但是当我测试游戏时,countdow 会冻结在一个数字或一个随机数上,这又是脚本:
脚本:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("IntermissonEvent")
local secondsRemaining = 15
for t = secondsRemaining, 0, -1 do
remoteEvent:FireAllClients(t)
wait(1)
end
本地脚本:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("IntermissonEvent")
local function onTimerUpdate(seconds)
script.Parent.Text =(seconds)
wait(15)
script.Parent.Parent.CountdownText.Visible = false
script.Parent.Parent.IntermissionText.Visible = false
script.Parent.Parent.TextLabel.Text ="Vote for a Map!"
script.Parent.Parent.MapVotingFrame.Visible = true
end
remoteEvent.OnClientEvent:Connect(onTimerUpdate)
【问题讨论】:
-
它是否始终冻结在同一个数字上?
-
它可以冻结在一个数字上。
标签: roblox