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: Keywords

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:16 PM
Keywords I can get confused on

Keywords:

else
elseif
break
local
function

(No one post just yet, im writing out examples for each and everyone)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:20 PM
if script.Parent.BrickColor = BrickColor.new ("Bright blue")
elseif if script.Parent.BrickColor = BrickColor.new ("Bright green")


Is this a correct demonstartion on elseif?

Else:

if script.Parent.BrickColor = BrickColor.new ("Bright blue")
else script.Parent.BrickColor = BrickColor.new ("Bright red")

Is this correct??
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
24 Oct 2013 10:23 PM
You forgot the thens, and else and elseif are used incorrectly.

You also forgot the ends.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:25 PM
Example of a correct one please?
Thanks!
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:26 PM
I tried these for other scripts, and I cant seem to use em' right.
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
24 Oct 2013 10:28 PM
Why do you keep doing a space before ("color")
if script.Parent.BrickColor == BrickColor.new("Bright blue") then
print('hi')
elseif
script.Parent.BrickColor = BrickColor.new("Bright green") then
print('hi')
end


if script.Parent.BrickColor = BrickColor.new("Bright blue") then
print('hi')
else
script.Parent.BrickColor = BrickColor.new("Bright red")
end
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
24 Oct 2013 10:29 PM
if checks == true then
-- yay
elseif checks == "lol" then
-- lel
else
-- stuff
end
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:36 PM
Thanks Guys!

specifically bob
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
24 Oct 2013 10:37 PM
Hold on i messed up
if script.Parent.BrickColor == BrickColor.new("Bright blue") then
print('hi')
elseif
script.Parent.BrickColor == BrickColor.new("Bright green") then
print('hi')
end


if script.Parent.BrickColor == BrickColor.new("Bright blue") then
print('hi')
else
script.Parent.BrickColor == BrickColor.new("Bright red")
end
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:38 PM
Question:

if script.Parent.BrickColor == BrickColor.new("Bright blue") then
print('hi')
elseif
script.Parent.BrickColor == BrickColor.new("Bright green") then
print('hi')
end


if script.Parent.BrickColor == BrickColor.new("Bright blue") then
print('hi')
else
script.Parent.BrickColor = BrickColor.new("Bright red")
end


when using if, dont I check using ==?
Also using elseif? I fixed it in this one.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:39 PM
I dunno about else though. Do i use ==?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 10:41 PM
Ok i see your post. Still one question.
I thought only in 'if' you used "==" but in else you put it.
this question I need just a yes or no. Do you put "==" in else?
Report Abuse
rtardbob123 is not online. rtardbob123
Joined: 13 Feb 2010
Total Posts: 15868
24 Oct 2013 10:43 PM
Yes
everywhere in a if statement you use == to see if it's equal to and ~= to see if it isn't equal to
>= to see if it's greater than something (num values only)
<= to see if something is lower than something(num values only)
Report Abuse
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
24 Oct 2013 10:52 PM
You got if's and elseif's right. Now for else's.

if part.BrickColor == BrickColor.new("Bright red") then
print("Brick is red")
else
print("Brick is not red")
end
Report Abuse
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
24 Oct 2013 10:53 PM
Now for break

x = true
function change()
x = false
end

while true do
wait(0.1)
change()
if x = false then break end
end
Report Abuse
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
24 Oct 2013 10:54 PM
Break ends the loop.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 11:09 PM
SO Basically saying "break" means ending the loop in an if, elseif, else, etc?

instead of this:

if script.Parent.BrickColor == BrickColor.new("Bright blue") then
end


You would say this?

if script.Parent.BrickColor == BrickColor.new("Bright blue") then
break
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 11:13 PM
Thanks! I think thats right!
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
24 Oct 2013 11:14 PM
Else just means "something else than above" right?
Thanks.
3 keywords now are: UNDERSTOOD!
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