|
| 28 Jul 2015 05:53 PM |
So what I'm trying to do is I'm trying to manipulate the TimeOfDay in the Lighting's Property to increase when a Part is touched. The TimeOfDay is currently at 16:00:00. I want to travel from 16:00:00 to 17:00:00 slowly, not fast.
Here's the script:
local debounce = true local lighting = game:GetService("Lighting") local duration = 0.1
script.Parent.Touched:connect(function() if debounce == true then debounce = false for i = 1, 1000 do wait(0.05) lighting.TimeOfDay = lighting.TimeOfDay + 1 end end end)
And if you're happening to know what the Output says, here it is:
15:47:07.062 - Workspace.Part.Script:11: attempt to perform arithmetic on field 'TimeOfDay' (a string value)
What does that mean? |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 05:54 PM |
You're trying to perform arithmetic on a string?
I thought that was pretty self-explanatory. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 05:55 PM |
Also use this:
http://wiki.roblox.com/index.php?title=API:Class/Lighting/GetMinutesAfterMidnight http://wiki.roblox.com/index.php?title=API:Class/Lighting/SetMinutesAfterMidnight |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 06:06 PM |
I did something different. It...sorta works. It just wont do as I type, it'll just change the TimeOfDay to "00:01:00"
local debounce = true local lighting = game:GetService("Lighting") local duration = 0.1
script.Parent.Touched:connect(function() if debounce == true then debounce = false for i = 1, 1000, 1 do wait(0.1) lighting = lighting + lighting:SetMinutesAfterMidnight(tostring(i)) end end end)
And now the Output says:
16:04:31.280 - Workspace.Part.Script:11: attempt to perform arithmetic on upvalue 'lighting' (a userdata value)
Help? |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 06:10 PM |
Bump.
Growing old is mandatory - growing up is optional. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 06:14 PM |
Double Bump.
Growing old is mandatory - growing up is optional. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 06:18 PM |
Triple Bump.
Growing old is mandatory - growing up is optional. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 06:25 PM |
Never mind, I've figured it out.
Growing old is mandatory - growing up is optional. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2015 06:33 PM |
lighting:SetMinutesAfterMidnight(lighting:GetMinutesAfterMidnight() + 1)
??? |
|
|
| Report Abuse |
|
|