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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: IF Functions

Previous Thread :: Next Thread 
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
10 Aug 2012 03:20 PM
For say i am doing an if function.

while true do
wait(0.1)
if blahblah.Health == 50 then
blahblah.Health = 100
else if blahblah.Health == 100 then
return? what do i do here if the "if" isn't true
end end end
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
10 Aug 2012 03:21 PM
What?
Do you mean else?

while true do
if (blahblah.Health == 50) then print("Is 50")
elseif (blaahblah.Health == 100) then print("Is 100")
else print("Is neither 50 or 100"); end
end
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
10 Aug 2012 03:25 PM
your scripting style confuses me ,-,

i think mine is just sloppy

PewDiePie *Brofist* / Got Ice crown!! :D
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
10 Aug 2012 03:27 PM
DO NOT PUT A SPACE BETWEEN ELSE AND IF! >:O
Else and if are two diff. things!!
Use elseif.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
10 Aug 2012 03:28 PM
And when you do what I said above,
Remove one end. :P
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
10 Aug 2012 03:29 PM
@Zackery: You can put a space, but you need to put another end.

if (statement1) then
--
else
if (statement2) then
--
end
end

(Though if you're using other languages like Java or C++, it's "else if")
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
10 Aug 2012 03:30 PM
I know. I just wanted to teach him to use elseif for that stuff.
Or just use:

else
--BLAH
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Aug 2012 03:31 PM
What is blahblah?

while true do
wait(0.1)
if blahblah.Health == 50 then
blahblah.Health = 100
else
return
end end

~repeat wait() until script.Parent:HasALife()
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
10 Aug 2012 03:34 PM
@Thedeath, He's not USING that script. That was just an example for us so we know what he wants us to tell him.
Geez.
And HasALife() is not a Method. >:)
Report Abuse
Brofessions is not online. Brofessions
Joined: 30 Jul 2012
Total Posts: 214
10 Aug 2012 03:37 PM
It could be a custom method. Who knows.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
10 Aug 2012 03:40 PM
How do you make.... a 'Custom' method?
Do you mean like a function?
o.o'
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