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: Scripting Help...

Previous Thread :: Next Thread 
HappyRainbowPop is not online. HappyRainbowPop
Joined: 15 Jul 2012
Total Posts: 4
12 Aug 2012 09:08 AM
I need help of writing a script...

for example;
Like a countdown till zombies attack, when it reaches 0 zombies appear, and when the countdown untill zombie attack ends, when it reaches 0 they go.

I have a good idea for my place and would love to know how to script this.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
12 Aug 2012 09:12 AM
Use a for loop.

for Seconds=60,1,-1 do
print(Seconds.." seconds remaining...")
wait(1)
end
Report Abuse
URX is not online. URX
Joined: 10 Nov 2009
Total Posts: 1054
12 Aug 2012 10:18 AM
Plus to add onto that:
for Seconds=60,1,-1 do
print(Seconds.." seconds remaining...")
game.Lighting.ZOMBIES_NAME_HERE:Clone().Parent = game.Workspace
wait(0.1)
local p = Instance.new("Hint",game.Workspace)
p.Name="Zombieshere"
p.text="Zombies are attacking!"
wait(30)
game.Workspace.Zombieshere:Destroy()

end
Report Abuse
HappyRainbowPop is not online. HappyRainbowPop
Joined: 15 Jul 2012
Total Posts: 4
12 Aug 2012 11:02 AM
Thanks!
Report Abuse
HappyRainbowPop is not online. HappyRainbowPop
Joined: 15 Jul 2012
Total Posts: 4
12 Aug 2012 11:31 AM
It never worked *_*
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
12 Aug 2012 11:51 AM
for Seconds=60,1,-1 do
print(Seconds.." seconds remaining...")
game.Lighting.ZOMBIES_NAME_HERE:Clone().Parent = game.Workspace
wait(0.1)
local p = Instance.new("Hint",game.Workspace)
p.Name="Zombieshere"
p.text="Zombies are attacking!"
wait(30)
game.Workspace.Zombieshere:Destroy()

end

^You have to modify the script for it to work and put in the name of your Zombie Model. So change the ZOMBIES_NAME_HERE and Zombieshere

Also, put the zombies in game.Lighting or it won't work.

If it doesn't work, idk xD
Report Abuse
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
12 Aug 2012 11:54 AM
--For this you will need a complete model called Zombies stored inside Lighting, which is self-explanatory what it needs.

--SCRIPT BEGIN

while true do --Start the infinite loop
local h = Instance.new("Hint", Workspace) --Spawn a hint
h.Text = "Uh-oh! Zombies are coming!" --Make the hint say that
wait(4) --wait 4 seconds
for seconds = 30, 0, -1 do --Do it where the Seconds variable counts down from 30
h.Text = ("Time until zombies appear: "..seconds) --The text says how much time is left
wait(1) --Wait 1 second between loops
end --End the for loop
h.Text = "THE ZOMBIES ARE HERE! ZOMG" --Make the text say that
local z = game.Lighting.Zombies:Clone() --Clone the zombies
z.Parent = game.Workspace --Put them into Workspace
wait(30) --Wait 30 seconds
z:Destroy() --Get rid of the zombies
h.Text = "Phew, the zombies are gone!" --Make the text say that
wait(10) --Wait 10 seconds
h:Destroy() --Get rid of the hint (considering it will spawn again right away)
end --End the infinite loop
Report Abuse
URX is not online. URX
Joined: 10 Nov 2009
Total Posts: 1054
12 Aug 2012 11:56 AM
Why did you change the Clone to a local?
Report Abuse
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
12 Aug 2012 12:00 PM
Bcuz local runs faster :p

~This sig is false~
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