Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

What have I done wrong with these 4 lines of code? The lines after the first aren't working

Asked by 4 years ago
Edited 4 years ago

EDIT:

01local InRound = game.ReplicatedStorage.InRound
02local Timer = game.ReplicatedStorage.Timer
03local IntermissionScreen = game.StarterGui.Intermission.Frame
04local Maps = game.StarterGui.Intermission.Frame.MapBox.Maps
05local Menu = game.StarterGui.Menu.Frame
06 
07InRound.Value = false
08Timer.Value = 20 -- intermission time
09while InRound.Value == false do
10    repeat
11        Maps.Visible = false
12        wait(1)
13        Timer.Value -= 1
14    until Timer.Value == 30
15    Maps.Visible = true
View all 24 lines...

And yes I'm pretty positive it's not a spelling error or anything like that

0
DId you add in a repeat statement in the first line? FrontsoldierYT 129 — 4y
0
Is that your whole script? RazzyPlayz 497 — 4y
0
Yes there's a repeat statement above, and no that's not my whole script. I'll edit it into the post PatrickLovesJesus 15 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

On line 8 you set the timer value to 20. So in the first repeat until loop, when you subtract one from the timer, it will never reach 30, as it is already below 30 and going down further.

1
I'm just realizing that and I fixed the issue, but that doesn't seem to be the main problem. The GUI elements still don't seem to be appearing and disappearing when they're supposed to PatrickLovesJesus 15 — 4y
0
I think it is because you are changing the gui from the startergui. This will not change the client's gui, which is located in PlayerGui under each individual player. I recommend creating remote events that fire to each client, and have a local script that changes the gui whenever those events are fired. RedReedBird 205 — 4y
0
Sorry to be such a bother, I'm fairly new to scripting. I've been searching all over but can't really find an answer, how do I fire remote events? PatrickLovesJesus 15 — 4y
0
On the server side, remoteEvent:FireAllClients(arg1, arg2..., arg4) where there can be multiple arguments or none. On the client side, get the remote event and then do remoteEvent.OnClientEvent:Connect(function(arg1, arg2...arg4). Here's a better explanation on the developer API website: https://developer.roblox.com/en-us/api-reference/event/RemoteEvent/OnClientEvent RedReedBird 205 — 4y
Ad

Answer this question