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: I'm so tired and this script wont work

Previous Thread :: Next Thread 
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
05 May 2017 02:19 AM
stole it from the wiki and edited a bit.


lightPart = game.Workspace.LightPart
minutesAfterMidnight = 0

while true do
minutesAfterMidnight = minutesAfterMidnight + 10
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)

if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM
script.Parent.Material = Enum.Material.Plastic
end

if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM
script.Parent.Material = Enum.Material.Neon

end
end


Report Abuse
Dankvisky is not online. Dankvisky
Joined: 04 Mar 2012
Total Posts: 5430
05 May 2017 03:55 AM
lightPart = game.Workspace.LightPart
minutesAfterMidnight = 0

while true do
minutesAfterMidnight = minutesAfterMidnight + 10
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)

if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM
lightPart.Material = Enum.Material.Plastic
end

if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM
lightPart.Material = Enum.Material.Neon

end
end


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
05 May 2017 01:37 PM
I want many lightparts so I want to change it to parent I have no problem with that but when I play I get a weird error.
Report Abuse
iReIix is not online. iReIix
Joined: 31 Aug 2010
Total Posts: 5175
05 May 2017 01:46 PM
add else

then add prints to check


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
05 May 2017 01:49 PM
Why not you do the work and then tel me because I don't have time to read and educate myself on that.
Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
05 May 2017 01:50 PM
tell*

I am on ipad.
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
05 May 2017 02:24 PM
"Why not you do the work i dont have time to read and educate myself."

(◉ ͜ʖ◉) Boi.


Report Abuse
Calviski is not online. Calviski
Joined: 03 Dec 2016
Total Posts: 209
05 May 2017 02:30 PM
then leave seal

we've educated ourselves, learned Lua ourselves

go away
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
05 May 2017 02:34 PM
Honestly, if you can't read your own damn output and realize that it tells you exactly what the problem is, scripting may not be for you.

All I did was remove the first line since that part obviously doesn't exist if you're using Parent, move the script under a brick, and add a little modulo because having an infinitely growing variable is dangerous.


minutesAfterMidnight = 0

while true do
minutesAfterMidnight = (minutesAfterMidnight + 10)%1440
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
print(minutesAfterMidnight)

if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM
script.Parent.Material = Enum.Material.Plastic
end

if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM
script.Parent.Material = Enum.Material.Neon

end
end


Report Abuse
spinywind is not online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
05 May 2017 03:22 PM
@Cal you're not the one to talk cause your posting forums on how to "make a gui go away" lol.


#Code print("Look behind you huehuehuehue")
Report Abuse
Calviski is not online. Calviski
Joined: 03 Dec 2016
Total Posts: 209
05 May 2017 04:08 PM
@spiny


I'm a beginner, and atleast I'm bothering to learn it, unlike OP.
Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:21 PM
My output showed something like

"Attempt to connect failed: Passed value is not a function"

But thanks if that works I'd be happy.


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:22 PM
I also do read my output I'm not stupid or anything like you thinking I don't read my output.



Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:24 PM
Still the same result with your dumb script
.


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:26 PM
Well thanks anyways since I am still tired and don't know what I am doing.


I could not sleep since of the heat for a few nights.


Report Abuse
ahwz is not online. ahwz
Joined: 01 Apr 2010
Total Posts: 3230
06 May 2017 06:28 PM
your error has nothing to do with that script

"Attempt to connect failed: Passed value is not a function"

check your ":Connect"'s
if you do something like part.Touched:Connect(func()) you'll get that same error.




Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
06 May 2017 06:37 PM
My script has nothing to do with making connections. Your console error is coming from another 'dumb script' of yours.


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:39 PM
It's not your script really.

It was my other scripts in studio well sorry bout' your temper tantrums.


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:41 PM
'bout*


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
06 May 2017 06:45 PM
?????????????
Go outside.


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:45 PM
I was but sometimes I am addicted to the computer, thanks for the reminder. I think you should too.


Report Abuse
Sealbutterscotch is online. Sealbutterscotch
Joined: 27 Oct 2013
Total Posts: 17326
06 May 2017 06:49 PM
Thanks for the anger, that totally helped even though your dumb script was the same thing.



Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
06 May 2017 06:56 PM
( ͡ ° ͜ ʖ ͡ ° )


Report Abuse
Inductive is not online. Inductive
Joined: 28 May 2012
Total Posts: 6480
06 May 2017 07:01 PM
There's actually no need to check if it's 6 AM or 6 PM, because you already know the minutes so it's redundant.

You could alter the script like this to remove those checks:

minutesAfterMidnight = 0

while true do
for i = 1, 36 do
minutesAfterMidnight = (minutesAfterMidnight + 10)%1440
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
print(minutesAfterMidnight)
end
script.Parent.Material = Enum.Material.Plastic -- It is 6 AM
for i = 1, 72 do
minutesAfterMidnight = (minutesAfterMidnight + 10)%1440
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
print(minutesAfterMidnight)
end
script.Parent.Material = Enum.Material.Neon --It is 6 PM
for i = 1, 36 do
minutesAfterMidnight = (minutesAfterMidnight + 10)%1440
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
print(minutesAfterMidnight)
end
end



Alternatively, you could condense the loops by having the script start at 6:AM.

minutesAfterMidnight = 360

while true do
for i = 1, 72 do
minutesAfterMidnight = (minutesAfterMidnight + 10)%1440
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
print(minutesAfterMidnight)
end
script.Parent.Material = Enum.Material.Neon -- It is 6 AM
for i = 1, 72 do
minutesAfterMidnight = (minutesAfterMidnight + 10)%1440
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
print(minutesAfterMidnight)
end
script.Parent.Material = Enum.Material.Plastic --It is 6 PM
end

While it's a bit disappointing that people would be mad at you for basically wanting to learn, saying "I don't have time to read, please do this for me" is really not a good way to get people to help you, especially on this forum. Anyway, have fun.
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
07 May 2017 06:10 AM
Don't mind OP, its a known idiot lol


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