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: Give me a test on basic scripting

Previous Thread :: Next Thread 
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:17 PM
If someone can give me a really basic test on scripting. Keep in mind that i just got to the if then commands. I would really appreciate it.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
21 Jan 2014 09:17 PM
a = true and false or nil

What is a?
Report Abuse
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:18 PM
a is the variable that equals it. and yeah i haven't got to the nil stuff yet.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
21 Jan 2014 09:20 PM
Oh, and while you're at it, explain why.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
21 Jan 2014 09:20 PM
No, I mean if it is true, false, or nil. Nil means nothing and is not considered truthy.
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
21 Jan 2014 09:20 PM
script.Parent.Touched:connect(function(hit)
if hit.Name = "Bob" then


Now, fill it in so that it kicks the player. Hmm, let me make it simple. So it kills the player

~Hope I helped, if you need a script, PM me. ~Glory to CAT!~ ~CAT General Shawnyg~
Report Abuse
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:23 PM
a = true and false or nil

a is the variable that equals true and false or nil.

i'm guessing by explain it you mean this?
a = true and false or nil because it's what you chose the variable to be?

true = on
flase = off
nil = both?(guessing)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jan 2014 09:24 PM
true = true
not true = false
nil = nil
not nil = true
not not nil = false

"a = true and false or nil"
Expect a to always be nil (false or nil = nil)
Report Abuse
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:25 PM
oh so basically since true = false, they're both false, or nil?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jan 2014 09:26 PM
true and false or nil

Well what would happen here is:
if it's true, it would become false, which would become nil
if it's false, it would become nil
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
21 Jan 2014 09:27 PM
a = nil because and checks if the first argument is truthy, and if so returns the second one. true and false returns false, and if the first argument of or is not truthy then it returns the next argument, which is nil.
Report Abuse
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:27 PM
what is nil?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jan 2014 09:28 PM
Pretty much nothing
Report Abuse
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:29 PM
alright, so can somebody give me another test?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jan 2014 09:32 PM
local isValid = (
      (
            Game.Workspace.Terrain ~= nil and
            true and
            not nil and
            Game.FindFirstChild and
            not false and
            Game.Destroy
      ) or
      "lol'd"
)
Report Abuse
mcas1996 is not online. mcas1996
Joined: 05 Jun 2013
Total Posts: 161
21 Jan 2014 09:35 PM
yeah i'll just go back to LuaLearners and re-read it all xD
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