|
| 02 Apr 2016 09:31 PM |
SO in my game there will be a clock and a day gui like in freddy's I want my script to add "1" to my textbox which contains the text "Day : 0" so when the time in the clock is 0:0:00 the day becomes No.Of days + 1. I made the time with Lighting. Here is what I tried
tm = game:service("Lighting")
when "Lighting" == 0:00:00 do script.Parent.Text == "..Day : 0..",+1 end It didn't work |
|
|
| Report Abuse |
|
|
Crimsonal
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1795 |
|
| |
|
| |
|
|
| 02 Apr 2016 09:45 PM |
Alright I see your new to scripting, and that's okay.
Here is a list off all the errors you did: * service is not an inbuilt function of game * 'when' is invalid; does not exist in lua * you put lighting in quotation marks and have not identified it * unwanted commas and wrong placement of periods * you put 2 equals when you needed to only put one.
Here is a revised script: while true do wait() if "Lighting" == 0:00:00 do script.Parent.Text == "Day"..":"0..+1 -- I don't even know what you are even trying to do here end end
Alright, just tell me what you were trying to do where I marked it and I'll try to help :) |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 02 Apr 2016 09:48 PM |
"when "Lighting" == 0:00:00 do"
"when"
LOL WHY IS DEV IN UR NAME
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$11,519 Tx40 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 09:52 PM |
It's Dev'Construction'
He probably builds stuff
idek |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:09 PM |
I think this is what you want?
day = 0
if game.Lighting.TimeOfDay == "00:00:00" then day = day + 1 script.Parent.Text = ("Day: " .. tostring(day)) end
|
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:11 PM |
| im looking at the revised script i posted and i dont even know what i was thinking |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:16 PM |
| Yes, I am new and I meant "While" not "When" but let me try one of your solution. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Apr 2016 10:28 PM |
| Exo, I tried yours it didn't work. |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:28 PM |
What errors (if any) come out in the output?
|
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:31 PM |
day = 0
while game.Lighting.TimeOfDay == "00:00:00" do wait() day = day + 1 script.Parent.Text = ("Day: " .. tostring(day)) end
|
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:32 PM |
I just want a script that can add a number into a Gui's Text. Day(Textbox).text : Day :0
tm = game:service("Lighting")
when "Lighting" == 0:00:00 do script.Parent.Text == "..Day : 0..",+1 end Please welp. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Apr 2016 10:34 PM |
:GetMinutesAfterMidnight()
|
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:34 PM |
| Where do I put that I am asking because im New |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:39 PM |
game.Lighting.Changed:connect(function() if game.Lighting.Time == 0 then --code end end) |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:51 PM |
| Hey, Lua_Basics It did not work. |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:55 PM |
game.Lighting.Changed:connect(function() if game.Lighting.TimeOfDay == "00:00:00" then print('Day time if gone') end end) |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2016 10:58 PM |
| No idea what your trying to do with the text. |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2016 11:05 AM |
I just need a script that can add 1 day to my screen gui based on my screen gui clock.
local Watch = script.Parent == Clock script. while true do Watch.Text = game.Lighting.TimeOfDay wait(.1) end
|
|
|
| Report Abuse |
|
|
|
| 03 Apr 2016 11:09 AM |
local day = 0
game.Lighting.Changed:connect(function() if game.Lighting.TimeOfDay == "00:00:00" then print('Day time if gone') script.Parent.Tex = ' Day:'..day end end) |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2016 11:18 AM |
Hey, Lua_Basics I tried your script and made "script.Parent.Tex" into "script.Parent.Text" I think I can play around with your script. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Apr 2016 12:06 PM |
| Did you change the time? Because it should work, otherwise it has something to do with whatever your changing the text of. |
|
|
| Report Abuse |
|
|