How to use :GetPropertySignalChanged on os.time()

Hello-

I’m trying to make a while true do loop run every time os.time value changes. I would think I could use the :GetPropertySignalChanged function. However, I don’t know how to use it in this situation… Anyone have any ideas to help me?

What I came up with: (Not working obviously lol)

local startTime = 73428973289
local timeNow = os.Time()

os:GetPropertySignalChanged("Time"):Connect(function(Player)
      while wait(1) do
            if timeNow >= startTime then
                  game.ReplicatedStorage.ShowGUI:FireClient(Player)
            end
      end
end)

EDIT: Or rather, instead of that, how can I make the while true do loop go, and be able to define the “Player” instance under the :FireClient??

i don’t think GetPropertySignalChanged works for os

1 Like

What about RunServer.Stepped?

i would use runservice.heartbeat

How often does a heartbeat occur?

if the server is healthy it fires 60 times a second

i looked at the API reference and it said it depends on the machine it’s running on

1 Like

I would use:
local rs = game:GetService(“RunService”)
predefined ^-----^-----^ so I’m not RE-RE-RE +++ defining the lib every time I check.

then in the loop
rs.Stepped:Wait()

or you will checking that 50,000+ times a sec

1 Like