(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?
