|
| 28 Jun 2012 10:42 PM |
So, I tried to script this... The purpose of it is to add a GUI in the StarterGui at a certain time of day, yet remove it after the 1:00:00 in game.
game.Players.PlayerAdded:connect(onPlayerEntered) if game.Lightning.TimeOfDay(13:00:00) or (15:00:00) then StarterGui.RainGUI:remove()
if game.Lightning.TimeOfDay(14:00:00) then game:service("InsertService"):LoadAsset(85046152).Parent=StarterGui end end |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2012 10:43 PM |
if game.Lighting.TimeOfDay == "13:00:00" Try that.
~Moo~ |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2012 11:07 PM |
I tried, didn't work:
game.Players.PlayerAdded:connect(onPlayerEntered) if game.Lightning.TimeOfDay == "13:00:00" or "15:00:00" then StarterGui.RainGUI:remove()
if game.Lightning.TimeOfDay == "14:15:00" and "14:30:00" then game:service("InsertService"):LoadAsset(85046152).Parent=StarterGui end end |
|
|
| Report Abuse |
|
|
| |
|
dasfunny
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 911 |
|
|
| 28 Jun 2012 11:56 PM |
| shouldn't it be a or instead of or ........ just guessing. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2012 11:56 PM |
game.Players.PlayerAdded:connect(onPlayerEntered) if game.Lightning.TimeOfDay == "13:00:00" or game.Lighting.TimeOfDay == "15:00:00" then StarterGui.RainGUI:remove()
if game.Lightning.TimeOfDay == "14:15:00" and game.Lighting.TimeODay == "14:30:00" then -- You know this will never Triiger right? game:service("InsertService"):LoadAsset(85046152).Parent=StarterGui end end |
|
|
| Report Abuse |
|
|
dasfunny
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 911 |
|
|
| 28 Jun 2012 11:57 PM |
game.Players.PlayerAdded:connect(onPlayerEntered) if game.Lightning.TimeOfDay == "13:00:00" or "15:00:00" then StarterGui.RainGUI:remove()
if game.Lightning.TimeOfDay == "14:15:00" or "14:30:00" then game:service("InsertService"):LoadAsset(85046152).Parent=StarterGui end end
try dat. btw try getting the name from lightning instead fo loadasset thats the only other thing I can think of. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 29 Jun 2012 02:34 PM |
I started from scratch to make it easier and work correctly
while true do wait() if game.Lighting:GetMinutesFromMidnight() < 780 or game.Lighting:GetMinutesFromMidnight() > 900 then player = game.Players:GetChildren() for i=1, #player do if player[i].PlayerGui:findFirstChild("RainGUI") then player[i].StarterGui.RainGUI:remove() end end elseif game.Lighting:GetMinutesFromMidnight() == 840 then player = game.Players:GetChildren() for i=1, #player do game:service("InsertService"):LoadAsset(85046152).Parent = player[i].PlayerGui end end end
give that a try. It should give everyone the gui (when its 14:00), or remove it (when its earlier than 13:00 or later than 15:00) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Parthax
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 6941 |
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 30 Jun 2012 06:39 AM |
game.Players.PlayerAdded:connect(onPlayerEntered) if game.Lightning.TimeOfDay(13:00:00) or (15:00:00) then StarterGui.RainGUI:remove()
if game.Lightning.TimeOfDay(14:00:00) then game:service("InsertService"):LoadAsset(85046152).Parent=StarterGui end end
1) I dont really know if the insert service works. I think its better that you make some stuff in for example lighting and clone that.
Another problem is that PROBABLY the time never gets EXACTLY 13:00:00. Try something in the form of this;
if game.Lighting.TimeOfDay == "13:00" or game.Lighting.TimeOfDay=="15:00" then game.Lighting.Clone:Clone().Parent = game.StarterGui end
(ITS game.StarterGui, NOT startergui!)
Like this it doesnt count seconds. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 06:41 AM |
@Jobro Not sure, but shouldn't it be
if game.Lightning.TimeOfDay(13:00:00) or game.Lightning.TimeOfDay(15:00:00) then
Instead? |
|
|
| Report Abuse |
|
|