r/ComputerCraft • u/Ornery_Scale_7043 • Feb 03 '24
how do i do this
hey uhm does anyone know how to extract a variable from a table
i mean i made this snipit of code:
ship.getworldSpaceposition()
HOW DO I GET A VALUE FROM A TABLE like y = "some y level" in the table and i want to get it out of it
1
Upvotes
1
u/netvip3r Feb 04 '24 edited Feb 04 '24
assuming
_tableis a table..you did not include your snippet of code for the function
ship.getworldSpaceposition()making it difficult to accurately respond1
u/fatboychummy Feb 03 '24
I don't know what mod you're working with so I don't know the exact return format, but there's two good possibilities:
The first is if they define the table with
yas a key, the second is if they define it as an array. Try each out, and see which one works. If neither work, please post the name of the mod you're trying to interface with and I'll see if I can find some documentation for what it returns.1
u/toasohcah toastonryeYT Feb 04 '24
I'm curious, what mods are you using to do this?
0
u/Ornery_Scale_7043 Feb 03 '24
bcs idk
2
u/[deleted] Feb 04 '24
[removed] — view removed comment