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: "unexpected symbol near 'do'"

Previous Thread :: Next Thread 
MsMike999 is not online. MsMike999
Joined: 23 Jun 2010
Total Posts: 7631
10 Jul 2011 01:33 PM
m = script.Parent.Sound
p = script.Parent.Sound.Pitch
s = script.Parent.Parent.Speed.Value
-------------------------------------------
m:Play()

while do true
p = s
end


The output window said:
unexpected symbol near 'do'
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:34 PM
Change it to
while true do

But that script is gonna crash you anyway, so be careful :P
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 01:34 PM
while true do, not while do true.


:33333333333333333333333333333333333333333333333333333333
Report Abuse
MsMike999 is not online. MsMike999
Joined: 23 Jun 2010
Total Posts: 7631
10 Jul 2011 01:36 PM
@Dr
How do I fix it so it doesn't?
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:36 PM
Add a wait. While true do makes it repeat forever and ever, and without a wait it will go so fast that it crashes.

Try doing something like

while true do
--do your stuff
wait(1)
end
Report Abuse
Uberself is not online. Uberself
Joined: 08 Jul 2011
Total Posts: 3
10 Jul 2011 01:40 PM
m = script.Parent.Sound
p = script.Parent.Sound.Pitch
s = script.Parent.Parent.Speed.Value
-------------------------------------------
m:Play()

while true do
p = s
end
Report Abuse
Flurite is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
10 Jul 2011 01:47 PM
Instead of adding ANOTHER line, you can be cool, and do..

while wait() do
--code
end
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:48 PM
"Instead of adding ANOTHER line, you can be cool, and do.."

Not only is that method frowned upon, it will put a small delay before the code executes, where he may prefer it to be afterward.
Report Abuse
MsMike999 is not online. MsMike999
Joined: 23 Jun 2010
Total Posts: 7631
10 Jul 2011 01:54 PM
Also, that "P = s" isnt working.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:56 PM
Do p.Value = s
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:56 PM
Oh, I misread. ignore my last post
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
10 Jul 2011 01:58 PM
"Not only is that method frowned upon"

I'm not sure it's really frowned upon. Since wait() returns values, it still treats it like 'true,' while also giving you that delay. As you said, it wouldn't always be good to use it in some scenarios, but it isn't wrong to use.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 02:11 PM
"I'm not sure it's really frowned upon. Since wait() returns values, it still treats it like 'true,' while also giving you that delay."

I've met multiple people who say that it is indeed bad coding. While yes, it does return values, wait is not meant to be used like that, as it could change in the future.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
10 Jul 2011 08:37 PM
Yes, I would never code that way, however I personally don't think it matters :P
Report Abuse
karateperson is not online. karateperson
Joined: 19 Feb 2010
Total Posts: 1988
10 Jul 2011 08:47 PM
while true do with no wait crashes your computer, or so I heard.
So yah, while wait() do
Report Abuse
nickmaster24 is not online. nickmaster24
Joined: 04 Oct 2008
Total Posts: 8906
10 Jul 2011 08:50 PM
@Flurite

You stole my trick...
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