Information Below I have these these two timer GUIs, now working, but my problem is, is that the time is different for every player. I am trying to make the time global, and stay the same for every player throughout the server. In example:
time = 30 for i = 1, 30 do wait(1) time = time - 1 script.Parent.Text = tostring(time) end script.Parent.Text = "Commencing Purge." --[[ It used to have local before the time, so I removed that, but it is still different for every player. How do I make it the same time server-wide ]]--
Thanks!
EDIT: That was confusing, basically, Every time a player dies, or joins the game, the time starts over on whichever GUI is active, what I am having trouble with, is the time staying the same throughout player death and joining, basically, The same time for the whole server. Thanks again!
What you currently have is that it's a script inside a player. What you can do is put a value inside workspace and have it connect to that and have a main script that changes the time on that value.. (This isn't the best way to do it but it's one that I like to do as you can edit it fairly easily.)
Here is the script that will change the time, you can edit it if you know what you are doing or if you need more help just comment below and i will provide more details.
local time = game.Workspace:FindFirstChild("Time") -- time needs to be an IntValue inside workspace. for i = 1, 30 do wait(1) i = i - 1 end
Here is the script that should be inside the player.. Above should be in a script inside the workspace. It can be anywhere for that script..
local time = game.Workspace:FindFirstChild("Time") time.changed:Connect(function(TimeChange) script.Parent.Text = time.Value end)
This way you can edit it fairly easily. Again, the first script goes into workspace and the 2nd script is a local script inside the StarterGUI. (Can be a normal? I duno)