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: Script Error?

Previous Thread :: Next Thread 
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 07:58 PM
Hello,

I have this script, and on line 8 it says, "then" is expected to be near "=". Please help:

script.Parent = game.Workspace
wait(1) --Game Time
if
game.Players.NumPlayers = 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"

else
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "New Game Starting in 10..."
wait(0.1)
m.Text = "New Game Starting in 9..."
wait(0.1)
m.Text = "New Game Starting in 8..."
wait(0.1)
m.Text = "New Game Starting in 7..."
wait(0.1)
m.Text = "New Game Starting in 6..."
wait(0.1)
m.Text = "New Game Starting in 5..."
wait(0.1)
m.Text = "New Game Starting in 4..."
wait(0.1)
m.Text = "New Game Starting in 3..."
wait(0.1)
m.Text = "New Game Starting in 2..."
wait(0.1)
m.Text = "New Game Starting in 1..."
wait(1)
m.Text = "Game Loaded"
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 07:58 PM
Whoops I meant line 4.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 07:59 PM
script.Parent = game.Workspace
wait(1) --Game Time
if game.Players.NumPlayers == 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"
else
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "New Game Starting in 10..."
wait(0.1)
m.Text = "New Game Starting in 9..."
wait(0.1)
m.Text = "New Game Starting in 8..."
wait(0.1)
m.Text = "New Game Starting in 7..."
wait(0.1)
m.Text = "New Game Starting in 6..."
wait(0.1)
m.Text = "New Game Starting in 5..."
wait(0.1)
m.Text = "New Game Starting in 4..."
wait(0.1)
m.Text = "New Game Starting in 3..."
wait(0.1)
m.Text = "New Game Starting in 2..."
wait(0.1)
m.Text = "New Game Starting in 1..."
wait(1)
m.Text = "Game Loaded"

† KMXD †
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
07 Mar 2012 07:59 PM
if
game.Players.NumPlayers = 1 then --2 Equal signs

if
game.Players.NumPlayers == 1 then
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
07 Mar 2012 07:59 PM
> game.Players.NumPlayers = 1

= defines
==compares

you need ==
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
07 Mar 2012 08:00 PM
I blame my late toasts on my failed username...
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:00 PM
Ah. Thanks. Works now.
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:03 PM
Wait one more thing, I updated it a bit now at line 10 it says < eof > expected near else:

script.Parent = game.Workspace
wait(1) --Game Time
if
game.Players.NumPlayers == 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"
end

else if
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "New Game Starting in 10..."
wait(0.1)
m.Text = "New Game Starting in 9..."
wait(0.1)
m.Text = "New Game Starting in 8..."
wait(0.1)
m.Text = "New Game Starting in 7..."
wait(0.1)
m.Text = "New Game Starting in 6..."
wait(0.1)
m.Text = "New Game Starting in 5..."
wait(0.1)
m.Text = "New Game Starting in 4..."
wait(0.1)
m.Text = "New Game Starting in 3..."
wait(0.1)
m.Text = "New Game Starting in 2..."
wait(0.1)
m.Text = "New Game Starting in 1..."
wait(1)
m.Text = "Game Loaded"
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:03 PM
No problem.

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:04 PM
You need 2 ends.

† KMXD †
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:04 PM
Where would I put them?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:05 PM
Both at the bottom.

† KMXD †
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
07 Mar 2012 08:05 PM
2 ends?
He only needs 1.

if
elseif
end

~Tada
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:06 PM
Still has the same error:

--LOADER V.1---------------------------------------------------------------------------------------------
--MADE BY 1billybob1 DO NOT STEAL------------------------------------------------------------------------
--USED FOR MY GAMES--------------------------------------------------------------------------------------

script.Parent = game.Workspace
wait(1) --Game Time
if
game.Players.NumPlayers == 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"
end
else if
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "New Game Starting in 10..."
wait(0.1)
m.Text = "New Game Starting in 9..."
wait(0.1)
m.Text = "New Game Starting in 8..."
wait(0.1)
m.Text = "New Game Starting in 7..."
wait(0.1)
m.Text = "New Game Starting in 6..."
wait(0.1)
m.Text = "New Game Starting in 5..."
wait(0.1)
m.Text = "New Game Starting in 4..."
wait(0.1)
m.Text = "New Game Starting in 3..."
wait(0.1)
m.Text = "New Game Starting in 2..."
wait(0.1)
m.Text = "New Game Starting in 1..."
wait(1)
m.Text = "Game Loaded"
end
end
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
07 Mar 2012 08:06 PM
Oh wait never mind,
He typed in else if not elseif.

Broski you gotta put the else and the if on two seperate lines are also my Brain will be unable to comprehend the assets you have displayed >:|
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
07 Mar 2012 08:08 PM
See!?!?!?
'lines are also'
'lines or also'
I just made my typo of the day >:/
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:08 PM
@Billy
Remove the "end" in the beginning of the script.

@xvg

Yea, I prefer "elseifs".

† KMXD †
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:09 PM
It still says < eof > expected near else.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:10 PM
Post the script again.

† KMXD †
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:11 PM
wait I got that fixed. Theres only one more problem.

script.Parent = game.Workspace
wait(1) --Game Time
if
game.Players.NumPlayers == 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"
elseif
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "New Game Starting in 10..."
wait(0.1)
m.Text = "New Game Starting in 9..."
wait(0.1)
m.Text = "New Game Starting in 8..."
wait(0.1)
m.Text = "New Game Starting in 7..."
wait(0.1)
m.Text = "New Game Starting in 6..."
wait(0.1)
m.Text = "New Game Starting in 5..."
wait(0.1)
m.Text = "New Game Starting in 4..."
wait(0.1)
m.Text = "New Game Starting in 3..."
wait(0.1)
m.Text = "New Game Starting in 2..."
wait(0.1)
m.Text = "New Game Starting in 1..."
wait(1)
m.Text = "Game Loaded"
end
end

line 9 says: unexpected symbol near local.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
07 Mar 2012 08:11 PM
> if
game.Players.NumPlayers == 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"
end
else if

if you have that end there you can't use `else` or `elseif`.

    if game.Players.NumPlayers == 1 then
        local m = Instance.new("Message")
        m.Parent = game.Workspace
        m.Text = "Not enough players"
    elseif--no space==one end needed

then at the end just have one end.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:12 PM
script.Parent = game.Workspace
wait(1) --Game Time
if game.Players.NumPlayers == 1 then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Not enough players"
else
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "New Game Starting in 10..."
wait(0.1)
m.Text = "New Game Starting in 9..."
wait(0.1)
m.Text = "New Game Starting in 8..."
wait(0.1)
m.Text = "New Game Starting in 7..."
wait(0.1)
m.Text = "New Game Starting in 6..."
wait(0.1)
m.Text = "New Game Starting in 5..."
wait(0.1)
m.Text = "New Game Starting in 4..."
wait(0.1)
m.Text = "New Game Starting in 3..."
wait(0.1)
m.Text = "New Game Starting in 2..."
wait(0.1)
m.Text = "New Game Starting in 1..."
wait(1)
m.Text = "Game Loaded"
end

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Mar 2012 08:13 PM
What? I feel like xvg. . . D:

† KMXD †
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
07 Mar 2012 08:13 PM
oh yeah it also should be else not elseif because it has no condition.
Report Abuse
1billybob1 is not online. 1billybob1
Joined: 15 Jun 2008
Total Posts: 4852
07 Mar 2012 08:15 PM
Ah, most of it works, also, is NumPlayer a behavior?
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