generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help with scripting days

Previous Thread :: Next Thread 
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
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 is not online. Crimsonal
Joined: 23 Apr 2011
Total Posts: 1795
02 Apr 2016 09:34 PM
>_<

Report Abuse
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
02 Apr 2016 09:42 PM
Help?
Report Abuse
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
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 is not online. 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
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
02 Apr 2016 09:52 PM
It's Dev'Construction'

He probably builds stuff

idek
Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
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
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
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
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
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
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
02 Apr 2016 10:23 PM
o that makes more sense
Report Abuse
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
02 Apr 2016 10:28 PM
Exo, I tried yours it didn't work.
Report Abuse
exoSentinel is not online. exoSentinel
Joined: 18 Mar 2012
Total Posts: 2795
02 Apr 2016 10:28 PM
What errors (if any) come out in the output?


Report Abuse
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
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
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Apr 2016 10:34 PM
:GetMinutesAfterMidnight()


Report Abuse
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
02 Apr 2016 10:34 PM
Where do I put that I am asking because im New
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
02 Apr 2016 10:39 PM
game.Lighting.Changed:connect(function()
if game.Lighting.Time == 0 then
--code
end
end)
Report Abuse
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
02 Apr 2016 10:51 PM
Hey, Lua_Basics It did not work.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
02 Apr 2016 10:58 PM
No idea what your trying to do with the text.
Report Abuse
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
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
DevConstruction is not online. DevConstruction
Joined: 19 Sep 2014
Total Posts: 42
03 Apr 2016 11:19 AM
It didnt work
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image