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: If Thread = nil then

Previous Thread :: Next Thread 
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
17 Oct 2012 07:00 PM
'Nil' means that the subject in question does not exist, right?

Example;

while true do
if Thread = nil then
Thread.existence.value = false
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Oct 2012 07:06 PM
its == nil

=: Set
==: Compare
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
17 Oct 2012 07:08 PM
Well, first off you need two equal signs to ask if something is equal to another value,
if Thread==nil then

Now, the 'Thread.existence.value=false' will not work, for Thread doesn't exist in the first place, so it can't have a value named existence in it.

And, for while true do loops, you must have some kind of wait in it

while wait(1)do -- the wait can replace the 'true' condition, since wait(1) won't return false because it exists.
if not Thread then -- Same as ==nil in this case
Instance.new("StringValue",game.Workspace).Name="Thread"
end
end
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
17 Oct 2012 07:10 PM
@wood, the op was asking if his definition of nil is true. You don't need to go all out on the thread.
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
17 Oct 2012 07:11 PM
I think that if you re-read my post, you'll find that I was asking you what 'nil' means, NOT to correct my example.
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
17 Oct 2012 07:11 PM
He was doing it wrong. In all fairness, it was fine to correct him.
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
17 Oct 2012 07:12 PM
Thank you, Death.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
17 Oct 2012 07:13 PM
nil is false, though, like in English, a condition will return true with a double negative
for instance

if not nil then
print('hi')
end
>hi

bewm

numbers can also return true/false on their own, without == to compare them
0 == false
natural numbers (possibly negative integers) == true


allout
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
17 Oct 2012 07:14 PM
print(nil==false)

Lua Learners - Elite
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