Hello, I have FilteringEnabled ticked in Workspace and it's the first time I've used a RemoteEvent to do a countdown.
I want to do know if there is a more efficient way for this to work, I have like 5 RemoteEvents in ReplicatingStorage and was wondering if I was only suppose to use 1 and just change the data or something xD
Anyway:
5 RemoteEvents in ReplicatingStorage called "3, 2, 1 , Go, donecountdown"
Serverscript:
local RemoteEventthree = game.ReplicatedStorage.three
local RemoteEventtwo = game.ReplicatedStorage.two
local RemoteEventone = game.ReplicatedStorage.one
local RemoteEventGo = game.ReplicatedStorage.Go
local RemoteEventdonecountdown = game.ReplicatedStorage.donecountdown
RemoteEventthree:FireAllClients(three)
wait(1)
RemoteEventtwo:FireAllClients(two)
wait(1)
RemoteEventone:FireAllClients(one)
wait(1)
RemoteEventGo:FireAllClients(Go)
--code
wait(1)
RemoteEventdonecountdown:FireAllClients(donecountdown)
LocalScript:
local Eventthree = game.ReplicatedStorage.three
local Eventtwo = game.ReplicatedStorage.two
local Eventone = game.ReplicatedStorage.one
local EventGo = game.ReplicatedStorage.Go
local Eventdonecountdown = game.ReplicatedStorage.donecountdown
Eventthree.OnClientEvent:connect(function(three)
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = 3
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Visible = true
end)
Eventtwo.OnClientEvent:connect(function(two)
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = 2
end)
Eventone.OnClientEvent:connect(function(one)
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = 1
end)
EventGo.OnClientEvent:connect(function(Go)
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = "Go!"
end)
Eventdonecountdown.OnClientEvent:connect(function(donecountdown)
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Visible = false
end) |