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

how to get ClockTime? What function can get ClockTime?

Asked by 5 years ago
Edited 5 years ago

(I'm making AI script. when ClockTime is Under 6 or Over 17, They need to disappear. when I try to get ClockTime directly, only a time work.)

I'm trying to get Lighting.ClockTime but it doesn't get.

then, I'm going to try to get time with RemoteFunction.

--Server
wait(1)

while wait(1) do
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local FunctionEvents = ReplicatedStorage.GiveClockTime
    for i,v in pairs(game.Players:GetChildren()) do
        local Time = FunctionEvents:InvokeClient()
    script.Parent.Parent.GlobalTime.Value = Time
    end
end
--Client
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ClockRequest = ReplicatedStorage.GiveClockTime

local function OnInvokeTime()
    local Clock = game.Lighting.ClockTime
    return Clock
end

ClockRequest.OnClientInvoke = OnInvokeTime

but, Still, don't work. how should I use?

1 answer

Log in to vote
0
Answered by 5 years ago

I finally know, I was changing value from studio, not script. sorry.

Ad

Answer this question