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: Tables2(Thanks a lot nxtboy)

Previous Thread :: Next Thread 
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 04:27 PM
-___- For some reason in my life I NEVER studied tables.Which is weird because tables are like the most important thing in lua.I've learned lots of other things.Anonyomous functions, loops,statements,instances, I can go on but I'm changing the subject.
Anyway, Im gonna make a VIP with tables AND PLEASE DON'T FIX THE SCRITP!Just please tell me whats wrong so I can fix it myself.Thanks, here it is

local Table = {"miz656","DivinePheonix","Zarcius","SDuke524"}
if Table[1] = miz656;
Table[2] = DivinePheonix;
Table[3] = Zarcius;
Table[4] = SDuke524 then
game.Workspace.Part.Touched:connect(function()
game.Workspace.Part.CanCollide = false
game.Workspace.Part.Transparency = .5
else
game.Workspace.Part.Transparency = 1
game.Workspace.Part.CanCollide = true
end
end)

Once again, just please tell me what line is wrong and I'll try to fix it.DON'T FIX IT FOR ME!Tables are really important and for some reason I never really studied them.


Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
30 Aug 2011 04:29 PM
"if Table[1] = miz656;
Table[2] = DivinePheonix;
Table[3] = Zarcius;
Table[4] = SDuke524 then"

That's the part that's wrong. If you don't know what's wrong, then tables isn't the only thing you missed.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 04:35 PM
Wait, is this it?(Since its a if then statement)

if Table[1] == miz656;
Table[2] == DivinePheonix;
Table[3] == Zarcius;
Table[4] == SDuke524 then
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 04:44 PM
Hello?
Report Abuse
sonicdiablo is not online. sonicdiablo
Joined: 05 Feb 2009
Total Posts: 1661
30 Aug 2011 04:46 PM
Crazypotato is right, Go study back your conditions statements.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 04:48 PM
I got thisfrom wiki

local myArray = {"A string", 3.14159, workspace.Part}
print(myArray[1]) -- prints: A string
print(myArray[2]) -- prints: 3.14159
print(myArray[3]:GetFullName()) -- prints: Workspace.Part


:P That's pretty much the same thing I did exept I forgot saying

:GetFullName())

Is taht what I did wrong?
Report Abuse
sonicdiablo is not online. sonicdiablo
Joined: 05 Feb 2009
Total Posts: 1661
30 Aug 2011 04:53 PM
No.Look

Original

if Table[1] = miz656;
Table[2] = DivinePheonix;
Table[3] = Zarcius;
Table[4] = SDuke524 then


Fixed

if Table[1] = "miz656" and Table[2] = "DivinePheonix" and Table[3] = "Zarcius" and
Table[4] = "SDuke524" then

You have to add and if you want if something = something and something = .

Keywords of conditions statements = if/then/elseif/and/or
Report Abuse
sonicdiablo is not online. sonicdiablo
Joined: 05 Feb 2009
Total Posts: 1661
30 Aug 2011 04:54 PM
And add "" for you'r strings.
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
30 Aug 2011 04:55 PM
Miz, you don't know tables but you're taking students from OzzyPig's scripting helpers group?

Dude, you seriously need to brush up on your Lua.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 05:32 PM
@trappingnoobs

Dude, my friend said they werent important and another person sais they were :PSo I didn't know which one to pick.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 05:33 PM
And@sonic

Is that all I did wrong?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Aug 2011 05:34 PM
You're comparing strings to variables that you haven't set yet. ._.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Aug 2011 05:36 PM
You also didn't structure that right...

if [Conditon] do

function()

else -- This has no if statement that it could ever run with, it's INSIDE another function that would only run if it was false.

end -- End function

end -- End if
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Aug 2011 05:37 PM
Also, why not use a generic for loop?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 05:47 PM
Nvm, I figured it out :D

Ps
@Eletric
I didn't use a generic loop because Im studying that next :o.I first promised to myself do tables since I never did them.Then generic loop.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Aug 2011 05:58 PM
Well, when you learn tables, it's best to learn generic for loops (as they're the best way to loop through a table).


-Like an __AWESOME__ boss![my siggy pic](http://t6ak.roblox.com/64a4c92f65fb2f33a4382576efb1a0d6)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Aug 2011 08:06 PM
That why I learn tables FIRST then generic loop.
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