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: Need help on my script

Previous Thread :: Next Thread 
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
10 Mar 2013 06:52 PM

local easy = game.Lighting.Easy:Clone()
local med = game.Lighting.Med:Clone()
local hard = game.Lighting.Hard:Clone()
local extreme = game.Lighting.xtreme:Clone()
local h = Instance.new("Hint", Workspace)
local check = math.random(1,50)
local victory = game.Workspace.RoundOver


while true do

if check <= 10 then
h.Text = "A easy horde of zombies have been spotted!"
wait(3)
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
easy:Clone().Parent = game.Workspace
wait(60)
h.Text = "The zombies are leaving!"
wait(2)
victory:Play()
wait(2)
victory:Pause()
easy:Destroy()
else if check <= 20 and >10 then
h.Text = "A medium horde of zombies have been spotted!"
wait(3)
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
med:Clone().Parent = game.Workspace
wait(60)
h.Text = "The zombies are leaving!"
wait(2)
victory:Play()
wait(2)
victory:Pause()
med:Destroy()
end
else if check <= 40 and >30 then
h.Text = "A hard horde of zombies have been spotted!"
wait(3)
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
hard:Clone().Parent = game.Workspace
wait(60)
h.Text = "The zombies are leaving!"
wait(2)
victory:Play()
wait(2)
victory:Pause()
hard:Destroy()
end
else if check <= 50 and >40 then
h.Text = "Wait.. Whats going on here!"
wait(3)
h.Text = "The sky is going red!"
game.Lighting.Ambient = Color3.new(255,0,0)
game.Lighting.FogEnd = 400
wait(3)
h.Text = "Whats happening.. WAIT ZOMBIES!"
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
extreme:Clone().Parent = game.Workspace
wait(60)
h.Text = "I think we survived!!"
game.Lighting.Ambient = Color3.new(127,127,127)
game.Lighting.FogEnd = 1000
wait(2)
victory:Play()
wait(2)
victory:Pause()
extreme:Destroy()
end


I don't know how to fix it,
this is the output

line 26: 'end' expected (to close 'while' at line 10) near 'else'
Error:
line 27: unexpected symbol near '>'

~«stealing shopping carts since the 1930's»~
Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
10 Mar 2013 07:06 PM
bump

~«stealing shopping carts since the 1930's»~
Report Abuse
MrTechn0 is not online. MrTechn0
Joined: 23 Nov 2012
Total Posts: 1252
10 Mar 2013 07:09 PM
can you give us any type of errors our anything?
Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
10 Mar 2013 07:10 PM
line 26: 'end' expected (to close 'while' at line 10) near 'else'
Error:
line 27: unexpected symbol near '>'

~«stealing shopping carts since the 1930's»~
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Mar 2013 07:12 PM
You ended the if statement, before all of the elseifs. I'll try fixing it in a second.

¤ ¤ † K M <( •д• )> X D † ¤ ¤
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Mar 2013 07:14 PM


    local easy = game.Lighting.Easy:Clone()
    local med = game.Lighting.Med:Clone()
    local hard = game.Lighting.Hard:Clone()
    local extreme = game.Lighting.xtreme:Clone()
    local h = Instance.new("Hint", Workspace)
    local check = math.random(1,50)
    local victory = game.Workspace.RoundOver
    while true do
        if check <= 10 then
        h.Text = "A easy horde of zombies have been spotted!"
        wait(3)
        h.Text = "You have 60 seconds to fight them off!"
        wait(3)
        h.Text = nil
        easy:Clone().Parent = game.Workspace
        wait(60)
        h.Text = "The zombies are leaving!"
        wait(2)
        victory:Play()
        wait(2)
        victory:Pause()
        easy:Destroy()
        elseif check <= 20 and ​> 10 then
        h.Text = "A medium horde of zombies have been spotted!"
        wait(3)
        h.Text = "You have 60 seconds to fight them off!"
        wait(3)
        h.Text = nil
        med:Clone().Parent = game.Workspace
        wait(60)
        h.Text = "The zombies are leaving!"
        wait(2)
        victory:Play()
        wait(2)
        victory:Pause()
        med:Destroy()
        elseif check <= 40 and ​> 30 then
        h.Text = "A hard horde of zombies have been spotted!"
        wait(3)
        h.Text = "You have 60 seconds to fight them off!"
        wait(3)
        h.Text = nil
        hard:Clone().Parent = game.Workspace
        wait(60)
        h.Text = "The zombies are leaving!"
        wait(2)
        victory:Play()
        wait(2)
        victory:Pause()
        hard:Destroy()
        elseif check <= 50 and ​>40 then
        h.Text = "Wait.. Whats going on here!"
        wait(3)
        h.Text = "The sky is going red!"
        game.Lighting.Ambient = Color3.new(255/255,0,0)
        game.Lighting.FogEnd = 400
        wait(3)
        h.Text = "Whats happening.. WAIT ZOMBIES!"
        h.Text = "You have 60 seconds to fight them off!"
        wait(3)
        h.Text = nil
        extreme:Clone().Parent = game.Workspace
        wait(60)
        h.Text = "I think we survived!!"
        game.Lighting.Ambient = Color3.new(127/255,127/255,127/255)
        game.Lighting.FogEnd = 1000
        wait(2)
        victory:Play()
        wait(2)
        victory:Pause()
        extreme:Destroy()
        end
    end

¤ ¤ † K M <( •д• )> X D † ¤ ¤
Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
10 Mar 2013 07:17 PM
easy:Destroy()

is now underlined

~«stealing shopping carts since the 1930's»~
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
10 Mar 2013 07:20 PM
local easy = game.Lighting.Easy:Clone()
local med = game.Lighting.Med:Clone()
local hard = game.Lighting.Hard:Clone()
local extreme = game.Lighting.xtreme:Clone()
local h = Instance.new("Hint", Workspace)
local check = math.random(1,50)
local victory = game.Workspace.RoundOver
while true do
if check >= 10 then
h.Text = "A easy horde of zombies have been spotted!"
wait(3)
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
easy:Clone().Parent = game.Workspace
wait(60)
h.Text = "The zombies are leaving!"
wait(2)
victory:Play()
wait(2)
victory:Pause()
easy:Destroy()
elseif check <= 20 and check >= 10 then
h.Text = "A medium horde of zombies have been spotted!"
wait(3)
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
med:Clone().Parent = game.Workspace
wait(60)
h.Text = "The zombies are leaving!"
wait(2)
victory:Play()
wait(2)
victory:Pause()
med:Destroy()
elseif check <= 40 and check >= 30 then
h.Text = "A hard horde of zombies have been spotted!"
wait(3)
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
hard:Clone().Parent = game.Workspace
wait(60)
h.Text = "The zombies are leaving!"
wait(2)
victory:Play()
wait(2)
victory:Pause()
hard:Destroy()
elseif check <= 50 and check >= 40 then
h.Text = "Wait.. Whats going on here!"
wait(3)
h.Text = "The sky is going red!"
game.Lighting.Ambient = Color3.new(255/255,0,0)
game.Lighting.FogEnd = 400
wait(3)
h.Text = "Whats happening.. WAIT ZOMBIES!"
h.Text = "You have 60 seconds to fight them off!"
wait(3)
h.Text = nil
extreme:Clone().Parent = game.Workspace
wait(60)
h.Text = "I think we survived!!"
game.Lighting.Ambient = Color3.new(127/255,127/255,127/255)
game.Lighting.FogEnd = 1000
wait(2)
victory:Play()
wait(2)
victory:Pause()
extreme:Destroy()
end
end
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