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

How would i go about making this time script on a text box?

Asked by 4 years ago

So I have this script, but don't know how I would go about making time on a text box? Any help?

local Lighting = game:GetService("Lighting")
local button = script.Parent.TextLabal

local hourRaw = tonumber(Lighting.TimeOfDay:match("^%d+"))
local hour12h = math.floor(hourRaw % 12)
local isPM = (hour / 12) >= 1

if hour12h == 0 then
    hour12h = 12
end

1 answer

Log in to vote
0
Answered by 4 years ago

you created a button,


local button = script.Parent.TextLabal

1st you need to make sure if there is really such thing in the parent object, 2nd you may have a typo.

but mostly important, yes, there is a TextLabal you have created, but you have never try to put some text in it to display the information!!!!

Ad

Answer this question