I'm not sure what's wrong It seems fine but nope it ain't work.
while true do
wait()
if game.Lighting.TimeOfDay=="1:00:00" then
local l = game.ServerStorage.Stuff:Clone()
l.Parent=game.Workspace
end
end
I'm not sure what's wrong It seems fine but nope it ain't work.
while true do
wait()
if game.Lighting.TimeOfDay=="1:00:00" then
local l = game.ServerStorage.Stuff:Clone()
l.Parent=game.Workspace
end
end
##Solution
Though I do not know exactly how your script is changing times, I would always recommend using GetMinutesAfterMidnight and compare it with a number. I would also recommend for efficiency purposes, to change the while true do to a .Changed event. Having too many while loops may lead to lag in your game with too many of them.
##Final Script
game.Lighting.Changed:connect(function()
if game.Lighting:GetMinutesAfterMidnight() == (60) then --Sixty minues in an hour right? 1:00?
local Objects = game.ServerStorage.Stuff:Clone()
Objects.Parent = game.Workspace
end
end)
######Hopefully this answered your question, if so do not forget to hit the Accept Answer button. If you have any questions feel free to comment below. If you experience any errors, please check the Developer Console or Output depending on your testing environment and tell us what the issue is so we may assist you further.
local l = game.ServerStorage.Stuff:Clone()
while true do
wait()
if game.Lighting.TimeOfDay=="1:00:00" then
l.Parent=game.Workspace
end
end
Try that!
Doesn't work for some reason am I doing something wrong?
This script might end up breaking even more, because once the model "Stuff" has been placed in Workspace, if that model were to be completely removed it'd error saying nil value.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks.