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

How to make for 24 h button.Visible = true - How to make this, it's possible?

How to make for 24 h button.Visible = true ? button = script.parent thank u and best regards PPJASK

1 comment

0

My friend, please rewrite your question. What do you mean by 24 h? Put your code in a code block.

1 answer

This is possible using os.time() which is part of the os library.

How to get the current time:

print(os.time()) -- copy this.

Script:

local StartTime = 1613122865 -- change this to the current time
local EndTime = 0 -- change this to 24h from now using ( https://www.epochconverter.com/ )
local LatestTime = 0 -- change this to around like 30 minutes from the EndTime to avoid any huge bugs.

--[[
   END TIME MUST NOT BE IN MILISECONDS! 
   PRESS HUMAN DATE TO TIMESTAMP
]]

while wait() do
 if EndTime > os.time() then
      break
 elseif os.time() == EndTime or os.time() > EndTime then
           if os.time() < LatestTime then
                    local GUI = game:GetService("Players").LocalPlayer["PlayerGui"]
                    local Path = GUI["ScreenGui"]["Frame"]["Button"]
                    Path.Visible = true 
           else
                    local GUI = game:GetService("Players").LocalPlayer["PlayerGui"]
                    local Path = GUI["ScreenGui"]["Frame"]["Button"]
                    Path.Visible = false
                  end
            end
      end
end

If you need more help, consider checking out AlvinBlox's video as it uses the same method I'm explaining

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