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: Whats wrong?

Previous Thread :: Next Thread 
thepickleking1234 is not online. thepickleking1234
Joined: 24 May 2011
Total Posts: 2288
19 Jun 2012 05:37 PM
print("thepickleking1234's Day/Night cycle script loaded")

repeat
wait(60)
game.Lighting.TimeOfDay = "09:00:00"
wait(60)
game.Lighting.TimeOfDay = "10:00:00"
wait(60)
game.Lighting.TimeOfDay = "11:00:00"
wait(60)
game.Lighting.TimeOfDay = "12:00:00"
wait(60)
game.Lighting.TimeOfDay = "13:00:00"
wait(60)
game.Lighting.TimeOfDay = "14:00:00"
wait(60)
game.Lighting.TimeOfDay = "15:00:00"
wait(60)
game.Lighting.TimeOfDay = "16:00:00"
wait(60)
game.Lighting.TimeOfDay = "17:00:00"
wait(60)
game.Lighting.TimeOfDay = "18:00:00"
wait(60)
game.Lighting.TimeOfDay = "19:00:00"
wait(60)
game.Lighting.TimeOfDay = "20:00:00"
wait(60)
game.Lighting.TimeOfDay = "21:00:00"
wait(60)
game.Lighting.TimeOfDay = "22:00:00"
wait(60)
game.Lighting.TimeOfDay = "23:00:00"
wait(60)
game.Lighting.TimeOfDay = "00:00:00"
wait(60)
game.Lighting.TimeOfDay = "01:00:00"
wait(60)
game.Lighting.TimeOfDay = "02:00:00"
wait(60)
game.Lighting.TimeOfDay = "03:00:00"
wait(60)
game.Lighting:TimeOfDay = "04:00:00"
wait(60)
game.Lighting.TimeOfDay = "05:00:00"
wait(60)
game.Lighting.TimeOfDay = "06:00:00"
wait(60)
game.Lighting.TimeOfDay = "07:00:00"
wait(60)
game.Lighting.TimeOfDay = "08:00:00"
until false
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 05:38 PM
This is very very VERY inefficient...

I've seen many like this, they just cause lag. I would use MinutesAfterMidnight.






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
thepickleking1234 is not online. thepickleking1234
Joined: 24 May 2011
Total Posts: 2288
19 Jun 2012 05:39 PM
Hmmm Okay.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
19 Jun 2012 05:39 PM
Why not just:
while wait(1) do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + 1)
end
Report Abuse
thepickleking1234 is not online. thepickleking1234
Joined: 24 May 2011
Total Posts: 2288
19 Jun 2012 05:41 PM
Yeah sorry I'm a starting scripter...Lol
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 05:43 PM
Take a look here too:

http://www.roblox.com/Completely-Editable-Day-Night-Cycle-item?id=80775021

That makes it a lot simpler to learn, and to edit to your own needs. Especially if you need to change the speed very quickly.

Sorry for having the name "flappy" in it, it was used for my friend before :P







~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:10 PM
Lol @ OP

That's the kind of day/night script I use.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:11 PM
@ANTH0NY

Then you should also take a look at my script :P





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:12 PM
I use this

http://www.roblox.com/Extreme-Advanced-Day-Night-Script-item?id=20987147
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:18 PM
:o

I want to look at it :D





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:20 PM
It's really good
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:25 PM
Holy cheese....


It is freaking amazing...

I usually never use free models, but I suddenly want to use that.





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:25 PM
Lol, you should help me with this now:


Here is the script:


VIP = { "ANTH0NY4686" }
texture = "http://www.roblox.com/asset/?id=83905099"

function check(name)
for i = 1,#VIP do

if (string.upper(name) == string.upper(VIP[i])) then return true end
end
return false
end

local Door = script.Parent

function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture then
Door.CanCollide = false
wait(0.2)
Door.CanCollide = true

elseif (check(human.Parent.Name)) then
Door.CanCollide = false
wait(0.2)
Door.CanCollide = true


end
end
end

script.Parent.Touched:connect(onTouched)


What it does:
Door becomes non-cancollide when a VIP touches it.
Is subject to "followers" who can creep in after a VIP.


What I want it to do, either:
A) Kill non-VIPs when they touch it, or
B) Simply prevent non-VIPs from entering by pushing them away from the door
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:28 PM
Just make another line that checks if the texture isn't on, and kills the player if that happens.


:P





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:29 PM
Which would be....

Can you write in that line in the script?
That way I can just copy/paste the new script?
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:32 PM
I put it in your other thread :P

Sorry, let me go find it.





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:33 PM
if human.Parent.Torso.roblox.Texture ~= texture then
human.Humanoid.Health = 0
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:35 PM
VIP = { "ANTH0NY4686" }
texture = "http://www.roblox.com/asset/?id=83905099"
function check(name)
for i = 1,#VIP do
if (string.upper(name) == string.upper(VIP[i])) then return true end
end
return false
end
local Door = script.Parent
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture then
Door.CanCollide = false
wait(0.2)
Door.CanCollide = true
elseif (check(human.Parent.Name)) then
Door.CanCollide = false
wait(0.2)
Door.CanCollide = true
if human.Parent.Torso.roblox.Texture ~= texture then
human.Humanoid.Health = 0
end
end
end
script.Parent.Touched:connect(onTouched)



That might work, I don't really know. Check and let me know.







~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:37 PM
Just wondering, does this make more sense to you?
What the guy below me posted.

http://www.roblox.com/Forum/ShowPost.aspx?PostID=70310230
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:38 PM
Yes, check both and see which one works.







~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
19 Jun 2012 06:39 PM
The other guy was right.

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
19 Jun 2012 06:41 PM
Actually, I don't know. He had the right idea. The only thing Green did wrong was:

"human.Humanoid"

when "human" was already defined as the Humanoid.

† KMXD †
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:42 PM
Lol, would you like to give the whole script a try then?
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
19 Jun 2012 06:43 PM
Oh? I thought the human was described as the player, therefore I still needed to describe the Humanoid since he did human.Torso and the Torso isn't in the Humanoid :P






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
ANTH0NY4686 is not online. ANTH0NY4686
Joined: 21 Aug 2011
Total Posts: 7117
19 Jun 2012 06:47 PM
Neither of them worked. >.<
Just making sure I'm testing this right:

Even when the door is not open, if a non-VIP touches it, they should die, right?
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