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: Top mistake I do when scripting...

Previous Thread :: Next Thread 
poulsen is not online. poulsen
Joined: 23 Nov 2008
Total Posts: 15552
14 Oct 2012 08:49 PM
Forgeting wait(1)

If you ever do ROBLOX Studio WILL crash.

~ Let's have a Tea Party! C: ~
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
14 Oct 2012 08:51 PM
Ok.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
14 Oct 2012 08:57 PM
nopnopnop
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
14 Oct 2012 09:16 PM
print("Hi")

Whoops, I forgot a wait.

^
No, that's not how it works :/ You do not always need a wait

Lua Learners - Elite
Report Abuse
poulsen is not online. poulsen
Joined: 23 Nov 2008
Total Posts: 15552
14 Oct 2012 09:18 PM
chaoticregandpledge,

I know, but I'm talking about "while true do".

~ Let's have a Tea Party! C: ~
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
14 Oct 2012 09:22 PM
i = 0
while i<50 do
i = i+1
print("Hi"..tostring(i))
end

Doesn't need a wait()

Lua Learners - Elite
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
14 Oct 2012 09:29 PM
@Chaotic
I don't see a 'while true do' statement/thing in your code.
also,
a = 0
while true do
a = a + 1
end
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
14 Oct 2012 09:32 PM
a = 0
while true do
a = a + 1
if a == 10 then
print("I win :D")
end
end

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
ungh01 is not online. ungh01
Joined: 24 Dec 2008
Total Posts: 876
14 Oct 2012 09:39 PM
@swim
That will still break..

a = 0
while true do
a = a + 1
if a == 10 then
print("This is the proper function. :)")
break
end
end
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
14 Oct 2012 09:47 PM
Crap, you're right.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
14 Oct 2012 09:48 PM
I feel like Chaotic won that
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
14 Oct 2012 09:51 PM
@Crazy,
How..?
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
14 Oct 2012 09:53 PM
Because he used a 'while' loop in a correct way without the need for a 'wait'

'while (true) do' is basically like saying 'if (true) then'

It's simply looking for a 'true' or 'false' output.
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
14 Oct 2012 09:57 PM
Yea, except the OP meant 'while true do' where it will ALWAYS be true, where chaotic's will not always be true.
Report Abuse
poulsen is not online. poulsen
Joined: 23 Nov 2008
Total Posts: 15552
14 Oct 2012 10:06 PM
I'm pretty new to LUA and I just learned Functions and onTouch, so I didn't understand understand half of the replies, but it's fine! :)
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
14 Oct 2012 10:08 PM
First of all, it's not an acronym. It's Lua - 'Moon' in Portuguese.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
14 Oct 2012 10:36 PM
1. Lua is not an acronym
2. There is no such thing as onTouch
Report Abuse
poulsen is not online. poulsen
Joined: 23 Nov 2008
Total Posts: 15552
14 Oct 2012 10:38 PM
onTouch is a function.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Oct 2012 10:46 PM
can't you do this:

local Lol = 0

while true do
Lol = Lol + 1
if Lol >= 50 then
break
end
end
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
14 Oct 2012 10:49 PM
onTouch what you name your function. like this:

function onTouch(string)
print(string)
end

onTouch("Hi")

Output:
>Hi
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Oct 2012 10:50 PM
ohh lol, i though u were saying the event.

the Brick.Touched
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
15 Oct 2012 06:48 AM
Lol I know something cool too :)



script.Parent.ChildAdded:connect(function(child) child:Clone().Parent = script.Parent end)

Problem? Pity that roblox protected that :/
Report Abuse
poulsen is not online. poulsen
Joined: 23 Nov 2008
Total Posts: 15552
15 Oct 2012 07:04 AM
This is what I'm talking about:

function onTouch()
script.Parent.CanCollide = false
script.Parent.Transparency = 0.5
wait(1)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
end

game.Workspace.Door.Touched:connect(onTouch)


Which I made up for:

http://www.roblox.com/Tea-Time-with-Poulsen-place?id=93239622

~ Let's have a Tea Party! C: ~
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
15 Oct 2012 07:24 AM
The level of scripting is extremely high here. Facepalm.
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
15 Oct 2012 07:50 AM
Yus n00b.. Only l33t scriptoring nubs all0w3d
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