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 » Scripting Helpers
Home Search
 

Re: Help editing my script

Previous Thread :: Next Thread 
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
28 Jun 2012 10:43 PM
if game.Lighting.TimeOfDay == "13:00:00" Try that.

~Moo~
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
28 Jun 2012 11:55 PM
bump
Report Abuse
dasfunny is not online. 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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
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 is not online. 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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
29 Jun 2012 12:06 AM
Neither of them worked.
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
29 Jun 2012 12:35 AM
bump
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
29 Jun 2012 02:25 PM
bump
Report Abuse
jelly134 is not online. 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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
29 Jun 2012 02:59 PM
@Jelly, it didn't work.
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
30 Jun 2012 06:00 AM
bump
Report Abuse
Parthax is not online. Parthax
Joined: 27 Apr 2011
Total Posts: 6941
30 Jun 2012 06:04 AM
[ Content Deleted ]
Report Abuse
jobro13 is not online. 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
MasterOfDeathOnes is not online. MasterOfDeathOnes
Joined: 21 Mar 2009
Total Posts: 6975
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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