Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to get ClockTime? What function can get ClockTime?

(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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.