of     1   

0_0
#141074707Monday, July 21, 2014 6:13 PM GMT

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)
UncleTaz
#141074936Monday, July 21, 2014 6:16 PM GMT

With countdowns, I do suggest using remote events. Although I suggest you tinker around with it a bit more. They can be really useful. And instead of just writing the code over and over just use a for loop for 1 = 3, 0, -1 do game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = i if i == 0 then game.Players.LocalPlayer.PLayerGui.ScreenGui.Frame.Countdown.Text = "Go!" end --code end
0_0
#141075177Monday, July 21, 2014 6:19 PM GMT

Oh yeah, loops. I only used one RemoteFunction before and I had a wait(1) in there but for some reason the wait didn't work? I'll try again, thanks :)
0_0
#141076759Monday, July 21, 2014 6:35 PM GMT

Okay how about now? 2 RemoteEvents in ReplicatedStorage called ("Countdown, doneCountdown") ServerScript: local RemoteEvent = game.ReplicatedStorage.Countdown local RemoteEvent2 = game.ReplicatedStorage.doneCountdown RemoteEvent:FireAllClients(Countdown) wait(3) --code wait(1) RemoteEvent2:FireAllClients(doneCountdown) LocalScript: local Event = game.ReplicatedStorage.Countdown local Event2 = game.ReplicatedStorage.doneCountdown Event.OnClientEvent:connect(function(Countdown) game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Visible = true for i = 3, 1, -1 do game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = i wait(1) end game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Text = "Go!" end) Event2.OnClientEvent:connect(function(doneCountdown) game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Countdown.Visible = false end) It works but is that the most efficient I can get it do you think?
0_0
#141080592Monday, July 21, 2014 7:10 PM GMT

bump
UncleTaz
#141080730Monday, July 21, 2014 7:12 PM GMT

This is good!
0_0
#141081431Monday, July 21, 2014 7:18 PM GMT

:D Thanks for the loop reminder, now it's much more efficient than having like 5 RemoteFunctions xD

    of     1