【发布时间】:2020-12-18 18:09:35
【问题描述】:
(是的,我知道这已经很老了,但我对脚本很陌生...)
所以我又遇到了这个问题,如果玩家 2 在倒计时结束后加入游戏,倒计时数字保持 15 并且 MapVotingFrame 不会出现在玩家 2 上,但只会发生在玩家 1 上(就像我的第一个问题,但相反)这是第三次写剧本:
脚本:
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 = tostring(seconds)
if seconds == 0 then
script.Parent.Parent.MapVotingFrame.Visible = true
end
end
remoteEvent.OnClientEvent:Connect(onTimerUpdate)
【问题讨论】:
标签: roblox