Im making a windows XP game and im wondering how would you make it so a button can change another text label Multiple times my code is this:
script.Parent.Activated:Connect(function()
script.Parent.Date.Text = “Year: 2000/1/1”
end)
Im making a windows XP game and im wondering how would you make it so a button can change another text label Multiple times my code is this:
script.Parent.Activated:Connect(function()
script.Parent.Date.Text = “Year: 2000/1/1”
end)
you could just do: – or loop through the table, because I didn’t fully understand your request
local RandomText = {"Test", "Bacon", "LOL"}
while wait() do
script.Parent.Text = RandomText[math.random(#RandomText)]
end
so you click once and it goes like Year: 2000/1/1 and you click again then Year: 2000/1/2 and so on
Well that really depends on the month and how many days it contains. so you would need to use a table.
local Years = {2000 = {[1] = 31}}} -- [1] is the month and 31 is the amount of days in that month
is this so they can click and it changes it
No I only wrote an example of how it would look like, the table. But you might be able to use os.clock or something
Ok so yoy get what i mean then and doing the table would look like how you did it
Ok so you get what i mean then and doing the table would look like how you did it
so a player click a button and it changes the text of something and they click again and it changes again
Nvm that I suggest using os.time() and os.date()
alright so like a change time manually for a player like how you can on windows
So you are trying to get timezones?
No i am not just a click to change day on a calendar i made
I haven’t really used os.time() or os.clock() but you could do something like this
local Time – the amount of seconds since 2000
Time+= 86400
print(os.date("*t", TimeSince2000)) – will return a table containing the year, month, day etcetera of the current time based on the added amount which is 86400 seconds or 1 day every button click
local Button -- Button here
local TimeSince2000 = os.time({year = 2000, month = 1, day = 1, hour = 0, min = 0, sec = 0})
Button.MouseButton1Click:Connect(function()
Time += 86400
print(os.date("*t", Time))
end)
So you want it to go to the next day everytime you click on it?
Yes thats what i want but i can only get it to do it once
Try this? if it doesn’t work correctly then it’s most likely because I haven’t really done any research on the function, well I did just now for a few minutes.
local Button -- Button here
local TimeSince2000 = os.time({year = 2000, month = 1, day = 1, hour = 0, min = 0, sec = 0})
Button.MouseButton1Click:Connect(function()
TimeSince2000 += 86400
print(os.date("*t", TimeSince2000))
end)
Is their anything i need to rename because i tried it and nothing
Have a look at this os | Roblox Creator Documentation and then scroll down to day and you can probably get an answer from that.
I accidentally tried to change non existing variables read the updated reply