5/15/12

Using 'WAIT' Wisely

We're sorry!

We haven't been updating The Current Roblox News as much as we used to. This is because of iHtc's problem at the moment. (something to do with his mum & dad)
________________________________________________________________________________

Using 'wait' Wisely

A little cut out of what was posted on ROBLOX Blog:
Many script's want to run bit's of code at frequent intervals. For example, the script might might update the behaviour of a zombie. It need's to update condition's repeatedly, like checking the location of the closest player to the zombie.
ROBLOX is trying to tell you, that instead of using wait(), you can use wait(10) instead.

Because if you just leave the bracket () empty, wait() will be regening 1000 times a second, yet instead, you could just have 10 items regening a second. Games with just wait() tend to be the more laggy ones, making your player's just click [X] in the corner! (or of course your red O)

For example:


while true do
findClosestEnemy()
wait()
end

that, above isn't a good script. Can you spot the mistake?

But, this below, is correct. Can you see why?


while true do
findClosestEnemy()
wait(5.0)
end

Even I know how to do that, and I already did. (and you know how rubbish at scripting I am!) So really, ROBLOX is just giving you a reminder, but it's also a lesson for the people whose zombie game's are laggy!

iHtc

7 comments:

bigdrybones said...

I don't get it.

Unknown said...

@BigDryBones, I've got bits of this on a ROBLOX blog post: http://blog.roblox.com/2012/05/using-wait-wisely/

Anonymous said...

To find out how much the 'wait()' is actually doing. Go ahead and put this bit of code in the command bar or in a script.

n=time();wait();m=time();print(m-n)

The 'wait()' should be approximately 0.033.. of a second.
Anything below 0.033.. (if you put 0.01 as the 'x' value ( wait(x) ) then it would default to 0.033..
'wait(10)' is actually about 12 seconds.

This is what I got from experimenting with 'time()' and the 'wait()'

One more thing, for those who don't know what 'time()' is, it is the game time; total time for which the server has been running.

Anonymous said...

RobloxPC

RobloxMusicIds
RobloxPC
RobloxPC

Unknown said...

Helpful information.keep updating, Thank you
Roblox XBox 360 Game
Roblox Char Codes
Roblox Redeem Codes
Roblox Hack Generator
Roblox Vip Pass
Roblox Radio Codes
Roblox Apk Download
Roblox PS4
Roblox Hack Codes

Suji said...

Design Clothes For Your Roblox Avatar,
Design Roblox Clothes,
Roblox Clothes,

Sean Malone said...




Hey guys! If you want a working Roblox hack tool, which gives you unlimited ROBUX and TICKETS, I will share it to you. Me and my friends have been using this for quite some time and I wanna share it to you!


CLICK HERE for THE ROBLOX cheat tool

CLICK HERE for THE ROBLOX cheat tool


Enjoy guys! RoBLOX ROCKS!






Hey guys! If you want a working Roblox hack tool, which gives you unlimited ROBUX and TICKETS, I will share it to you. Me and my friends have been using this for quite some time and I wanna share it to you!


CLICK HERE for THE ROBLOX cheat tool

CLICK HERE for THE ROBLOX cheat tool


Enjoy guys! RoBLOX ROCKS!






Hey guys! If you want a working Roblox hack tool, which gives you unlimited ROBUX and TICKETS, I will share it to you. Me and my friends have been using this for quite some time and I wanna share it to you!


CLICK HERE for THE ROBLOX cheat tool

CLICK HERE for THE ROBLOX cheat tool


Enjoy guys! RoBLOX ROCKS!

Post a Comment